Commit ef79b420 by BellCodeEditor

auto save

parent 4abb891e
Showing with 18 additions and 0 deletions
dict={"张三":55,"李四":60,"王五":70}
dict["李四"]=80
dict["赵六"]=99
if "赵六" in dict:
print(dict["赵六"])
print(dict)
\ No newline at end of file
python1={"李":98,"王":99,"星":100,"颜":80} #创建班级字典,人名为键 语文成绩为值 李:98 王:99 星:100 颜:80 python1
python1["颜"]=100 #修改颜同学的语文成绩
print(python1["颜"]) #查看颜同学的语文成绩
if "刘" in python1: #查看刘同学的成绩是否在班级中,如果在就输出所有人成绩,
print(python1)
else: #如果不在就添加到班级中并且输出所有人成绩
python1["刘"]=100
print(python1)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment