您的位置:首页 > 编程语言 > Python开发

字典实战应用,笨方法学python

2017-03-15 22:28 218 查看
#coding=utf-8

#creat a mapping from child to account_name

children = {
'Hannibal': 'Des001',
'Shmily': 'Angel136',
'James': 'Feng128',
'Jayden': 'Luo125',
}

#Creat a basic set of account and passwords
accounts = {
'Des001': 'Hannibal01',
'Angel136':'Shmily01',
'Feng128': 'James01',
'Luo125': 'Jayden01',
}

print "Please input children\'s name:"

next = raw_input(">")

print " the %s account information is: %s, and the pw is %s" % (next, children[next], accounts[children[next]])
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python