python3.6 applet

# The query class
runs in python 3.6 pycharm (yes)

people = {
'Wang Fei': {
'Telephone': '2341',
'Address': 'Western Town Wangchuan Village'
},
'Xiaoyisan': {
'Phone ': '9102',
'address': 'No. 111, Taizi Village, Jile Palace Town'
},
'Mitchell': {
'Telephone': '3158',
'Address': 'Building 7, Building A, Rulai Community, Shunzhi Township 2nd floor west household'
}
}
kk = 0
print("The system can only query the population household registration of xxx county, and it can only be queried by rotation training for the time being")
while True:
if kk < 3:
name = input('Please enter the desired Query name: ')
if name in people:
requesr = input('Please enter phone number (p) or address (a): '
if requesr == 'p': requesr = '电话'
if requesr == 'a': requesr = '地址'
person = people.get(name, {})
result = person.get(requesr)
print("\t\t{}'s {} is: {}".format(name, requesr, result))
kk += 1
continue
if kk == 3:
break
else:
print("The user has not recorded...")

Operation result:
The system can only query the population household registration of xxx county, and it can only be queried in rotation mode for the time being.
Please enter the name to be queried: Wang Fei
, please enter the phone number (p) or address (a): a
The address of Wang Fei's home is: Western Wangchuan Village
, please enter the name you want to inquire: Xiaoyisan
, please enter the phone number (p) or address (a): pThe
phone number of Xiaoyisanjia is: 9102
, please enter the name you want to inquire: Mitchell
, please enter the phone number ( p) Or address (a): a
The address of Mitchell's house is: West House, 2nd Floor, Building A, Block A, Rulai Community, Shunzhi Township

// break out of the loop (exit the program)



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325213369&siteId=291194637