data ={ '魏X':{"語文":["150"], "數學":["150"], "英語":["150"], "綜合":{ '化學':["90"], '物理':["90"], }, }, '黃XX':{"語文":["150"], "數學":["150"], "英語 ...
data ={
'魏X':{"語文":["150"],
"數學":["150"],
"英語":["150"],
"綜合":{
'化學':["90"],
'物理':["90"],
},
},
'黃XX':{"語文":["150"],
"數學":["150"],
"英語":["150"],
"綜合":{
'化學':["90"],
'物理':["90"],
}
},
'陳璐陽':{"語文":["50"],
"數學":["20"],
"英語":["10"],
"綜合":{
'化學':["19"],
'物理':["29"],
},
},
}
fenshu_list = []
#exit_flag = False
while True:
for i in data:
print(i)
shuru = input("請輸入姓名:")
if shuru in data:
while True:
for i2 in data[shuru]:
print(i2)
shuru2 = input("請輸入科目名稱:")
if shuru2 in data[shuru]:
while True:
for i3 in data[shuru][shuru2]:
print("\t",i3)
p_item = data[shuru][shuru2]
fenshu_list.append(p_item)
print("----",shuru2,p_item)
shuru3 = input("返回上一層請按b :》》")
if shuru3 == "b":
break
else:shuru3 == "q"
print("%s----- 成績單----- %s" ,"\n",shuru,shuru2,p_item)
for j in fenshu_list:
print(j)
exit()