Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. # San Tayo Kakain App
  2. # by: [Your Last Name], [First Name]
  3.  
  4.  
  5. def open_file_and_get_content(filename):
  6. content = "TODO: Fill in to get content string from file"
  7.  
  8. return content
  9.  
  10.  
  11. def convert_string_to_restaurant_list(content):
  12. restaurant_list = []
  13. restaurant_list.append({"retaurant": "TODO: fill in to append all restaurants", "visited": False})
  14.  
  15. return restaurant_list
  16.  
  17.  
  18. def pick_random_resto(restaurant_obj_list):
  19. print("TODO: Fill in to pick a random restaurant you haven't visited")
  20.  
  21.  
  22. def show_restaurants(restaurant_obj_list):
  23. print("TODO: Fill in show restaurants in proper output format in the instructions")
  24.  
  25.  
  26. def mark_restaurant_visited(restaurant_obj_list):
  27. choice = input("Enter the restaurant number: ")
  28. print("TODO: Fill in to mark the choice", choice, "visited")
  29.  
  30.  
  31. def press_key_to_continue():
  32. input("Press enter key to continue..")
  33.  
  34.  
  35. def main():
  36. file_content = open_file_and_get_content('sample_resto_input.txt')
  37. restaurant_obj_list = convert_string_to_restaurant_list(file_content)
  38.  
  39. while True:
  40. print("""
  41. =======================
  42. San Tayo Kakain App
  43. =======================
  44.  
  45. (1) Pick a Random Restaurant You Haven't Visited
  46. (2) Show All Restaurants
  47. (3) Mark Restaurant as Visited
  48. (4) Exit
  49. """)
  50.  
  51. choice = input("Enter choice: ")
  52.  
  53. if choice == "4":
  54. print("Thank you for using the app, you beautiful person you! Have a nice day!")
  55. break
  56. elif choice == "3":
  57. mark_restaurant_visited(restaurant_obj_list)
  58. press_key_to_continue()
  59. elif choice == "2":
  60. show_restaurants(restaurant_obj_list)
  61. press_key_to_continue()
  62. elif choice == "1":
  63. pick_random_resto(restaurant_obj_list)
  64. press_key_to_continue()
  65. else:
  66. print("Invalid choice")
  67. press_key_to_continue()
  68. # end if choice
  69. # end while True
  70.  
  71.  
  72. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement