python經(jīng)典實(shí)例——字典
提問(wèn)人:楊紫紅發(fā)布時(shí)間:2020-11-26
#! /usr/bin/python
x={'a':'aaa','b':'bbb','c':12}
print (x['a'])
print (x['b'])
print (x['c'])
for key in x:
print ("Key is %s and value is %s" % (key,x[key]))
'''
知識(shí)點(diǎn):
* 將他當(dāng)Java的Map來(lái)用即可.
'''
x={'a':'aaa','b':'bbb','c':12}
print (x['a'])
print (x['b'])
print (x['c'])
for key in x:
print ("Key is %s and value is %s" % (key,x[key]))
'''
知識(shí)點(diǎn):
* 將他當(dāng)Java的Map來(lái)用即可.
'''
繼續(xù)查找其他問(wèn)題的答案?
相關(guān)視頻回答
點(diǎn)擊加載更多評(píng)論>>