文件的读取
f=file('a.txt','r')
while True:
line=f.readline()
if len(line)==0:
break
else:
print(line),
print(line[0])
字典的使用
d={'1':'k1','2':'k2','3':'k3'}
print (type(d))
print (dir(d))
'clear', 'copy', 'get', 'has_key', 'items', 'iteritems', 'iterkeys', 'itervalues', 'keys', 'popitem', 'setdefault', 'update', 'values'
# result =d.items()
#字典的遍历
for i in d.items():
print (i)
for x,y in d.items():
print(x),
print(y)