import random
tourist_destinations = ['Prague Castle', 'Charles Bridge', 'Wenceslas Square',
'The National Museum', 'The Clementinum and the National Library',
'The Old Town Square and the Astronomical Clock', 'St. Vitus Cathedral',
'The Church of Our Lady before Týn', 'The National Gallery in Prague',
'The Municipal House', 'Prague Zoo', 'Josefov: The Jewish Quarter',
'The Strahov Monastery and Library', 'The Petrín Lookout Tower', 'The Lennon Wall']
def destinations(arr):
print('We will provide you with tourist destinations. You can choose your favorite.')
print('Press "y" to choose, press "n" to reject')
try:
choice = random.choice(arr)
print(choice)
answer = input('Does it suit you? ')
while (answer != 'y') and (answer != 'n'):
print('Please answer "y" or "n"')
answer = input('Does it suit you? ')
if answer == 'y':
print('Thank you for using our service.')
elif answer == 'n':
arr.remove(choice)
destinations(arr)
else:
print('Unknown error. Sorry. Will be fixed')
except IndexError:
print('no more selection required')
if __name__ == '__main__':
destinations(tourist_destinations)
Comments
Leave a comment