a = {1897:("Diptojit", "Sealdah", 9000000001),
2224:("Debanjan", "Tarakeshwar", 9000000002),
1758: ("Avinesh", "Metropolitan", 9000000003),
2283: ("Biswajit", "Garia", 9000000004)}
n = input("Enter name to know index : ")
lk = list(a.keys())
lv = list(a.values())
#print(lv[0])
for i in range(0,4):
if n == "('Biswajit', 'Garia', 9000000004)":
print(lk[lv.index(n)])
break
I am trying to search a value and get its key as the output. This program shows no output while in case of a simple dictionary, when all keys have just one value, this code works perfectly. Please Help.