直接使用Python3 字典get方法即可实现
# Enter a code d = {"Alice": 45, "Bob": 60, "Candy": 75, "David": 86, "Ellena": 49} print(d.get("Alice", "None")) # dict.get(key,默认返回值),不指定默认返回值则默认返回None print(d.get("Bob", "None")) print(d.get("Candy", "None")) print(d.get("Mimi", "None")) print(d.get("David", "None"))