list = [["alex","tiffany"],["richard","bella"],["bruno","jessica"]]
enter = input("enter name: ")
for i in list:
if enter == i[0]:
print(i[1])
else:
print("the name that you searched for is absent!")
break
Output 1:
enter name: alex
->tifanny
Output 2:
enter name: richard
->the name that you searched for is absent!
I want to print "bella" but my program doesn't do this. How can I solve this problem?
Aucun commentaire:
Enregistrer un commentaire