Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Person:
- def __init__(self,first_Name,last_Name,id,birth_date):
- self.firstName = first_Name
- self.lastName = last_Name
- self.id = id
- self.birth_date = birth_date
- def main_project():
- persons = []
- while True:
- print("Hello! welcome to Bituah Leumi")
- option = int(input("please choose: 1 to create person, 2 to create birth, 3 to serch, 4 to exit: "))
- # לחכות לתשובה
- # לפי התשובה להפנות לםונקציה ספציפית
- if (option == 1):
- new_person = add_person()
- persons.append(new_person)
- for i in persons:
- print (i.firstName),print(i.lastName),print (i.id)
- elif (option ==2):
- new_birth = add_birth()
- elif (option ==3):
- new_serch = add_serch
- elif (option ==4):
- exit()
- else:
- print("enter valid number:1-4")
- def add_person():
- first_name = input("enter your first name: ")
- while (not first_name.isalpha()):
- first_name = input("wrong name! pleas enter your first name correct: ")
- last_name = input("enter your last name: ")
- id = list(input("enter your id number: "))
- new_id =check_id(id)
- kid= input ("press 'yes'-if do you have kids and 'no' if you dont have kids:")
- if (kid == "yes"):
- done=0
- list_kids = []
- while done!='done':
- new_kid = add_person()
- list_kids.append(new_kid)
- done=input('add kid/done')
- for i in list_kids:
- print(i.firstName), print(i.lastName), print(i.id)
- else:
- list_kids='none'
- # persons.append(new_kid)
- p=Person(first_name,last_name,id,list_kids)
- return p
- def add_birth():
- pass
- def add_serch():
- pass
- def check_id(id):
- while len(id) < 9:
- id.insert(0, 0)
- return (id)
- def ege(self):
- age = 2019 - int(self.birth_date)
- return (age)
- main_project()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement