-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
36 lines (30 loc) · 843 Bytes
/
app.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
from person import person
format
db = Database()
print(f"Welcome to {db.name}!!!")
while True:
print('''\nChoose one of the following options:
1- Add a new member
2-Remove a member
3-Display all members
4-exit
''')
opt =int(input("Choose an option: "))
if opt == 1:
name = input("Enter their name: ")
age = int(input("Enter their age: "))
weight = float(input("Enter their weight: "))
job = input("Enter their job: ")
p = Person(name, age, job, weight)
db.add_person(p)
elif opt == 2:
name = input("Enter name of a person to be removed: ")
for person in db.people:
if person.name == name:
db.remove_person(person)
elif opt == 3:
db.display_all()
elif opt == 4:
break
else:
print("Invalid Option. Choose number from 1 to 4")