python实战练习1

 

 

a = {'city':'beijing', 'id':1}
b = {'city':'shanghai', 'id':2 }
c = {'city':'guanghzou', 'id':3}

d = []
d.append(a)
d.append(b)
d.append(c)

for i in d:
    # print(i)
    # print(type(i))
    print(i['city'] + '\'s id is ' + str(i['id']))

 

posted @ 2023-08-13 20:01  limalove  阅读(6)  评论(0)    收藏  举报