Commit 7cdd2c6e by BellCodeEditor

auto save

parent 45f5a7c0
Showing with 40 additions and 14 deletions
# 和你的小伙伴用列表讲讲桃园结义的故事,并说说这其中运用了哪些列表知识:
# 来,我给你起个头~
# 从前啊,有三个bro,分别是:刘备、关羽、张飞...
bro1="关羽"
bro2="刘备"
bro3="张飞"
bros=["刘备","关羽","张飞"]
bro1=["关羽",160,8.5]
bro2=["刘备",161,9.1]
bro3=["张飞",166,8.3]
bros[0]="关羽"
bros[1]="刘备"
print(bros)
\ No newline at end of file
# a={
# '张三':{'科学':100,'英语':90,'数学':98},
# '李四':{'科学':10,'英语':290,'数学':198},
# '王五':{'科学':20,'英语':190,'数学':398}
# }
# for i in a.items():
# print(i)
# #剥洋葱 一层一层往里递进
# # print(a['张三'])
# # print(a['张三']['科学'])
# for i in a:
# for j in a[i]:
# print(a[i][j])
# print(a['王五']['数学'])
# a=[
# ['姓名','科学','数学','英语','计算机'],
# ['1',2,3,4,1],
# ['张2三',100,90,80,178],
# ['2',100,90,80,278],
# ['3',100,90,80,378],
# ['4',100,90,80,278],
# ['5',100,90,80,178]
# ]
# a[0].append('总分')
# a[0].append('平均分')
# for i in a[1:]:
# s=0
# for j in i[1:]:
# s+=j
# ave=s/4
# i.append(s)
# i.append(ave)
# print(a)
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