entry_member =[["Amal",1111111111],["Mohammed",2222222222],["Khadijah",3333333333],["Abdullah",4444444444],["Rawan",5555555555],["Faisal",6666666666],["Layla",7777777777]]print("Welcome to our phonebook !!! \n""1 = To Add an entry\n""2 = To Delete an entry\n""3 = To Edit an entry\n""4 = To View all entries")
name = input()
number = input()
choose = input("Enter your choose?")whileTrue:if choose ==1:
name = input("Enter a name :- ")
number = input("Enter a phone number :- ")if len(number)!=10:print('Invalid phone number, please enter a 10 digit number')else:
entry_member.append([name, number])elif choose ==2:print("What is the entry you want to delete ?")for item in entry_member:if item[0]== name and item[1]== number:
entry_member.remove(item)elif choose ==3:print("What is the entry you want to edit ?")
name = input("Enter a phone name :- ")
number = input("Enter a phone number :- ")for item in entry_member:if item[0]== name and item[1]== number:
entry_member[entry_member.index(item)]=[name, number]elif choose ==4:for item in entry_member:print(f"Name: {item[0]}, Phone: {item[1]}")
السؤال
SamarAl
1 جواب على هذا السؤال
Recommended Posts
انضم إلى النقاش
يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.