Nalaganje naloge…
Filtering a dictionary is useful when you want to keep only important records, like products above a certain price or players with enough points. The function filter_dict_by_value receives a dictionary d and a number threshold. Return a new dictionary containing only the pairs whose value is at least threshold; smaller values should be left out.
({"a": 1, "b": 5, "c": 3}, 3){"b": 5, "c": 3}({}, 0){}({"x": 10}, 20){}def filter_dict_by_value(d: dict, threshold: int) -> dict:
Prijavite se za ogled zgodovine oddaj
PrijavaPrijavite se za uporabo mentorja UI
PrijavaThey run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.