-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact-tracing.py
64 lines (53 loc) ยท 2.21 KB
/
contact-tracing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#- Display a menu of options
# Menu:
# 1 -> Add an item
# 2 -> Search
# 3 -> Exit (y/n)
#- Allow user to select item in the menu (check if valid)
#- Perform the selected option
# - Option 1: Ask personal data for contact tracing (Listed are sample only, add more)
# Use dictionary to store the info
# Use the full name as key
# The value is another dictionary of personal information
# - Option 2: Search, ask full name then display the record
# - Option 3: Ask the user if want to exit or retry.
def menu_program():
menu= input("What would you like to do? [1-3] ")
if menu=="1":
personal_info={}
name = input("Enter user's full name: ")
age= input("Enter user's age: ")
address= input("Enter user's home address: ")
phone_num= int(input("Enter user's phone number: "))
info ={
"Full Name" : name,
"Age" : age,
"Home Address" : address,
"Phone Number" : phone_num
}
personal_info[name] = info
print(personal_info)
print("Saved!")
if menu=="2":
name= input("What is the full name of the person? " )
print(personal_info[name])
if menu=="3":
retry_exit = input("Do you wish to exit? (ใ
ยด ห `) Y/N: ")
if retry_exit == "n":
print("\n")
menu_program()
elif retry_exit == "y":
print("\n.ใปใ.ใปใโญใป.ใปโซใปใใปใ.ใปใ.ใปใโญใป.ใปโซใปใใปใ.")
print("See ya next time! Bye for now โ(แตแตแต)โ\n")
else:
print("\nEnter Y if you want to exit, or N to retry the program.")
exit()
print("\nโโยท โข โโ ู โค ู โโ โข ยท โข โโ ู โค ู โโ โข ยท โข โโ ู โค ู โโ โข ยทโโ")
print ("""
Menu
[1] โ Add an item
[2] โ Search
[3] โท Exit (Y/N)
""")
print("โโยท โข โโ ู โค ู โโ โข ยท โข โโ ู โค ู โโ โข ยท โข โโ ู โค ู โโ โข ยทโโ\n")
menu_program()