代码如下:
#encoding=utf-8
print '中国'
#创建字典 避免和标识符冲突
#方法一 ,for=123不能使用该参数 不能避免和标识符冲突
dict1=dict(green=1,blue=255,red=80)
print dict1
#方法二 能避免和标识符冲突
dict1={'green':1,'blue':255,'red':80,'for':123}
print dict1
#方法三 比四速度慢 能避免和标识符冲突
keys=('green','blue','red','for')
vals=(1,255,80,123)
dict1=dict(zip(keys,vals))
print dict1
#方法四 序列比较长的时候使用 能避免和标识符冲突
import itertools
dict1=dict(itertools.izip(ke......
阅读全文