I have a text file Phone_book with text as:
{'sunny': ('123456', 'sunny@gmail.com')}.
I would like to fetch values by calling key(sunny) in python 3. X.
def search_contacts(self):
key = input('Enter a name to search: ')
with open('Phone_Book.txt','r') as Phone_book:
print (Phone_book[key])
else:
print('not found')