Trying to understand what I am doing wrong here. The output I get when I type in "ohio" or "amsterdam" (or any other variable) is
Votes:
Robert: 0
Yukio: 0
Andrew: 1
I want the location chosen by the user to give the specified contestant (votesA, votesY, votesR) a point.
favorite_places = {
'Andrew': {
'place1': 'Tokyo',
'place2': 'Amsterdam',
},
'Yukio': {
'place1': 'Osaka',
'place2': 'Kyoto',
},
'Robert': {
'place1': 'Ohio',
'place2': 'Queensland',
'place3': 'Auckland',
}
}
print("Welcome to location quiz poller.\nThese are the contestants choice of favorite places."
"Please choose which place is the best, whoever has the most votes will win.")
votesA = 0
votesY = 0
votesR = 0
votinglist = []
for name, place in favorite_places.items():
#one way to label, access and print nested dictionary values
places = f"{place['place1']}\n{place['place2']}\n{place.get('place3', '')}\n"
print(f"{name}'s favorite places are: ")
print(f"{places}")
print("Which place is the best place?")
inp = input('Enter here: ')
inp = inp.lower()
if inp == 'tokyo' or 'amsterdam':
votesA += 1
elif inp == 'osaka' or 'kyoto':
votesY += 1
elif inp == 'ohio' or 'queensland' or 'auckland':
votesR += 1
else:
print('That is not a valid selection. -closing program-')
print(f"Votes:\n\tRobert: {votesR}\n\tYukio: {votesY}\n\tAndrew: {votesA}\n\t")