圣诞节的一天
作者:互联网
r1={"name":"高亮","age":23,"salary":30000,"city":"北京"}
r2={"name":"高2亮","age":213,"salary":40000,"city":"上海"}
r3={"name":"高3亮","age":223,"salary":50000,"city":"深圳"}
tb = [r1,r2,r3]
# 获得第二行的人的薪资
print(tb[0].get("salary"))
#打印所有人的薪资
for i in range(len(tb)): #i -->0,1,2
print(tb[i].get("salary"))
#打印表中的数据
for i in range(len(tb)):
print(tb[i].get("name"),tb[i].get("age"),tb[i].get("salary"),tb[i].get("city"))
标签:salary,city,圣诞节,name,get,age,一天,tb 来源: https://www.cnblogs.com/gaoliang0517/p/15731668.html