diff --git a/diy2.py b/diy2.py index 0af1dba..0541a90 100644 --- a/diy2.py +++ b/diy2.py @@ -1,7 +1,7 @@ -score = {'语文':91,'数学':88,'英语':85} - -# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来 -for k,v in score.items(): - print(k,v) - - +student1={'语文':91,'数学':88,'英语':85} +student2={'语文':92,'数学':88,'英语':85} +student3={'语文':91,'数学':88,'英语':90} +score={'悟空':student1,'诺伊':student2,"小贝":student3} +name=input('敏子') +for k,v in score[name].items(): + print(k,v) \ No newline at end of file