student = {} student["学号"] = "20210001" student["姓名"] = "张三" student["年龄"] = 18 student["性别"] = "男" if student.get("学号") == "20210001": print("学号为20210001的学生存在该字典中") else: print("学号为20210001的学生不存在该字典中") student["专业"] = "交通运输" student["年龄"] = 20 student.clear() print(student) # 输出:{} (字典已清空) [2024-10-29 15:38:27 | AI写代码神器 | 243点数解答]