Facebook
From m, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 110
  1. from Person import Person
  2.  
  3. Person.domain_name = input("Enter domain name\n")
  4. choice="yes"
  5. person_list = []
  6. while choice == "yes":
  7.         print("Enter details of person")
  8.         person_first_name = input("Enter first name\n")
  9.         person_last_name = input("Enter last name\n")
  10.         person_age = input("Enter age\n")
  11.         person_list.append(Person(person_first_name, person_last_name, person_age))
  12.         choice = input("Do you want to add the details of another person? Type yes/no\n")
  13.        
  14. print("Number of person objects created\n",Person.counter)
  15.  
  16. print("List Person Details\n")
  17. for person in person_list :
  18.     print("Full name of the person is ",person.fullname())
  19.     print(person)
  20.     print("\n")
  21.  
  22. print("Update Person Details")
  23. name = input("Enter the full name of the person whose details are to be updated\n")
  24.  
  25. for person in person_list :
  26.         if person.fullname() == name:
  27.                 print("Old age : ",person.age)                          ##getter
  28.                 age = input("Enter age\n")
  29.                 person.age = age                                                        ##setter
  30.                 print("Updated Person Details :")
  31.                 print(person)
  32.                 break
  33. else :
  34.         print("Person not found")
  35.        
  36.  
  37.  
  38.