0
Solve please.....
Tuple You are given a list of contacts, where each contact is represented by a tuple, with the name and age of the contact. Complete the program to get a string as input, search for the name in the list of contacts and output the age of the contact in the format presented below: Sample input John Sample output John is 31 If the contact is not found, the program should output "Not Found". Code: contacts = [ ("John", 23), ("Arif",34), ("Ajay",46), ("Max",19) ]
3 Réponses
+ 1
YOU are to solve the task. If you need help with your code, link your code attempt.
Hint: Get input. Use a loop to iterate the contacts. Use an if-statement to check whether the input name is in contacts.
0
Thanks
0
Lisa thanks