Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # San Tayo Kakain App
- # by: [Your Last Name], [First Name]
- def open_file_and_get_content(filename):
- content = "TODO: Fill in to get content string from file"
- return content
- def convert_string_to_restaurant_list(content):
- restaurant_list = []
- restaurant_list.append({"retaurant": "TODO: fill in to append all restaurants", "visited": False})
- return restaurant_list
- def pick_random_resto(restaurant_obj_list):
- print("TODO: Fill in to pick a random restaurant you haven't visited")
- def show_restaurants(restaurant_obj_list):
- print("TODO: Fill in show restaurants in proper output format in the instructions")
- def mark_restaurant_visited(restaurant_obj_list):
- choice = input("Enter the restaurant number: ")
- print("TODO: Fill in to mark the choice", choice, "visited")
- def press_key_to_continue():
- input("Press enter key to continue..")
- def main():
- file_content = open_file_and_get_content('sample_resto_input.txt')
- restaurant_obj_list = convert_string_to_restaurant_list(file_content)
- while True:
- print("""
- =======================
- San Tayo Kakain App
- =======================
- (1) Pick a Random Restaurant You Haven't Visited
- (2) Show All Restaurants
- (3) Mark Restaurant as Visited
- (4) Exit
- """)
- choice = input("Enter choice: ")
- if choice == "4":
- print("Thank you for using the app, you beautiful person you! Have a nice day!")
- break
- elif choice == "3":
- mark_restaurant_visited(restaurant_obj_list)
- press_key_to_continue()
- elif choice == "2":
- show_restaurants(restaurant_obj_list)
- press_key_to_continue()
- elif choice == "1":
- pick_random_resto(restaurant_obj_list)
- press_key_to_continue()
- else:
- print("Invalid choice")
- press_key_to_continue()
- # end if choice
- # end while True
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement