def cash_credit(question): valid_responses = {"cash": "cash", "ca": "cash", "credit": "credit", "cr": "credit"} while True: response = input(question).lower() if response in valid_responses: return valid_responses[response] print("Please choose a valid payment method.") def review_order(pizza_details, total_cost): print("\n<--- Order Summary --->") for detail in pizza_details: print(detail) print(f"\nTotal cost: ${total_cost:.2f}") confirm_order = string_checker("\nWould you like to confirm your order? (yes or no): ", ["yes", "no"]) if confirm_order == "no": print("\nOrder canceled.") return payment_method = cash_credit("\nChoose a payment method (cash or credit): ") print(f"You have chosen to pay with {payment_method}.") rating = input("Please rate your overall experience at Whanau Pizzeria (1-5) stars: ") while not rating.isdigit() or not 1 <= int(rating) <= 5: print("Invalid rating. Please enter a number between 1 and 5 stars.") rating = input("Enter your rating: ") rating = int(rating) comments = input("\nWould you like to leave any comments about your experience? (or press Enter to skip): ") print("\nThank you for your review!") print(f"You rated Whanau Pizzeria {rating}/5 stars. 🍕🎉") if comments: print(f"Comments: {comments}") print("\nYour order has been confirmed!")