python經(jīng)典實例——字典
提問人:楊紫紅發(fā)布時間: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]))
'''
知識點:
* 將他當Java的Map來用即可.
'''
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]))
'''
知識點:
* 將他當Java的Map來用即可.
'''
繼續(xù)查找其他問題的答案?
相關(guān)視頻回答
點擊加載更多評論>>