python字典的小例子

(helloworld) [root@iZ2ze7qh6q0di3qkvef1dzZ ~]# more dic_test.py

#!/usr/bin/python

info ={}

name=raw_input(“Please input name: “)

age=raw_input(“Please input age: “)

gender=raw_input(‘please input(M/F): ‘)

info[‘name’]=name

info[‘age’]=age

info[‘gender’]=gender

for k,v in info.items():

    print “%s:%s” % (k,v) 

print ‘main end’

    原文作者:甲骨文技术支持
    原文地址: http://blog.itpub.net/20893244/viewspace-2220461/
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞