Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- contact_list = [{'Name':'Luis', 'Number':351916675561},{'Name':'Kimossab','Number':-1}];
- str = input('Insert a name to look for the number: ');
- bool = 0
- for i in contact_list:
- if i['Name'] != str:
- continue
- else:
- bool = 1
- print(i['Number'])
- if bool == 0:
- print('Name not found.')
Advertisement
Add Comment
Please, Sign In to add comment