# Functions go here def string_check(question, valid_list=('yes', 'no'), num_letters=1): """Checks that users enter the full word or the first 'n' letters from a list""" while True: response = input(question).strip().lower() for item in valid_list: item_low = item.lower() if response == item_low: return item # Return actual item (with correct casing) elif response == item_low[:num_letters]: return item print(f"Please choose an option from {valid_list}") def instructions(): print("Pizza Paladin Instructions," "ℹ️") print(""" The program will record the users data that they entered, then proceed to the main menu of what Pizza Paladin offers. Once you have ordered your pizza (up to 5 maximum allowed), or entered the exit code (‘xxx’), the program will display the receipt information regarding the customers order and information, writing the data to a text file. The program proceeds by asking would you like to pick-up or deliver the pizza to your address. You enter 'Pick-up' or 'Deliver' For each customer should enter ... ------ (IF PICK-UP WAS CHOSEN) ------ - Their name - Their age - Phone number - The payment method (cash / credit) ------ (IF DELIVERY WAS CHOSEN) ------ - Their name - Their age - Phone number - Address - The payment method (cash / credit) The program will record the users data that they entered, then proceed to the order by printing a receipt """) # Main routine goes here print() want_instructions = string_check("Do you want to see the instructions? ") if want_instructions == "yes": instructions() print() print("program continues...")