d ={'peter': 'handsome', 'shutong':'cute'}#key:value
print('peter' in d)#is in ?
print(d['peter'])#下标访问内容
d['1']='11'
print(d['1'])
print(d['shutong'])
del d['1']
print('1' in d)

f = {'person':2, 'dog':4, 'man':3}

for  animals in f:
    legs = f[animals]
    print('a %s has %d legs'%(animals, legs))
    print('a %s has %d legs',(animals, legs))

 

numpy-dictionary

相关文章:

  • 2021-08-15
  • 2021-10-08
  • 2022-02-11
  • 2021-07-09
  • 2021-07-24
  • 2021-05-28
  • 2021-05-28
  • 2021-06-14
猜你喜欢
  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-12-03
  • 2021-05-24
相关资源
相似解决方案