- import random
- import time
- list_restaurants=['Island Grill','Green Curry','Sweet Escape','Bangalore Spices','Pancake World','Gordon Ramsay']
- print('!!!welcome to use LIBERA app!!!')
- time.sleep(1)
- def choice1(list_restaurants):
- while True:
- option1 =random.choice(list_restaurants)
- idea= input('are you okay with [%s], if so, input y, if not press enter.'%(option1))
- if idea=='y':
- print('Good Choice, Let\'s go to [%s]!!'%(option1))
- break
- list_custom=[]
- reason=input('What confused you:\n 1. Donnot know what to eat \n 2. Hard to choose from your own list\nplease input 1 or 2 :')
- if reason=='1':
- choice1(list_restaurants)
- elif reason=='2':
- while True:
- line = input('please input your restrants, click enter after each name, type"end"when you are done :)');
- if line =='end':
- break
- list_custom.append(line)
- option2=random.choice(list_custom)
- print('we think [%s] is a good choice!'%(option2))
- time.sleep(1)
- print('see you next time!')
- break
- else:
- print ('Sorry we only provide 2 options so far, please make choice between 1 nad 2!')