people = {
'Alice':{
'phone':'99115578',
'addr': 'BZD 18'
},
'Bold':{
'phone':'88115566',
'addr':'SKhD 10'
},
'Tsetseg':{
'phone':'96006056',
'addr':'SBD 1'
}
}
labels = {
'phone':'phone number',
'addr':'address'
}
name = input('Name: ')
request = input('Утасны дугаар (p) эсвэл хаяг (a) аль болохыг үсгээр оруул: ')
if request == 'p': key = 'phone'
if request == 'a': key = 'addr'
if name in people: print("%s's %s is %s." % (name, labels[key], people[name][key]))
No comments:
Post a Comment