Passing Students

Imagine a results table where each student has a name and a score. Write a function count_passing that receives a dictionary where each key is a student name and each value is their score, plus a passing threshold threshold. Count students whose score is at least the threshold. Return that count.

Примеры

Ввод
{"a": 90, "b": 50, "c": 70}, 60
Вывод
2
Ввод
{}, 50
Вывод
0
Ввод
{"x": 100}, 100
Вывод
1

Нужно реализовать

def count_passing(scores: dict, threshold: int) -> int:

Теги

dicthashmap
PostgreSQLv16

Qui apparirà il risultato dell'esecuzione del codice

Visible tests
1
Input
{"a":90,"b":50,"c":70}, 60
Expected2
2
Input
{}, 50
Expected0
3
Input
{"x":100}, 100
Expected1
4
Input
{"a":1,"b":2,"c":3}, 5
Expected0
5
Input
{"a":60,"b":60}, 60
Expected2
6
Input
{"k":59}, 60
Expected0
Focus radio
Paused · SomaFM · Fluid