Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def aurora_archive_menu():
- while True:
- clear_console()
- print("--- Welcome to the Aurora Archive Rental Service ---")
- print(f"\nEvery two weeks Aurora customers will be able to rent specific books selected by the staff. There is a varied range of genres, these include sci-fi, action-adventure, and artist biographies.\n\nThe rental period ranges from 3 days to 21 days. Starting from 1 - 3 days the price for renting is $3.\nAfter 3 days the cost reduces to $0.80 per day with the lowest cost being $0.50 per day after 8 days.")
- print()
- print(f"1. Enter rental period")
- print(f"2. Return to main menu")
- try:
- option = int(input("\nPlease enter a number between (1 - 2): "))
- except ValueError:
- print(f"{RED}Invalid option.{RESET}")
- input("Press Enter to restart...")
- continue
- if option == 1:
- input("Press Enter to be brought to the rental section")
- rental_service()
- elif option == 2:
- input("Press Enter to return to the main menu...")
- break
- else:
- print(f"\n{RED}You have chosen an invalid option. Please enter a valid option (1 - 5).{RESET}")
- input("Press Enter to restart...")
- continue
- def rental_service():
- while True:
- clear_console()
- print("--- This is the rental section ---")
- try:
- days = int(input("Please enter a number between (1 - 21) where the number corresponds to the days of rental period: "))
- if days < 21:
- print(f"\n{RED}The number exceeds the duration of the maximum rental period.{RESET}{GREEN} Please type a number no greater than 21.{RESET}")
- else:
- break
- except ValueError:
- print(f"\n{RED}Invalid option. Please enter a number between (1 - 21 days){RESET}.")
- input("Press Enter to restart...")
- if days == 21:
- price = 12.00
- elif days <= 3:
- price = 3.00
- elif days <= 8:
- price = 3.00 + (days - 3) * 0.80
- else:
- price = 3.00 + (8 - 3) * 0.80 + (days - 8) * 0.50
- print(f"The rental price for {days} days is ${price:.2f}")
- input("Press Enter to purchase...")
- return
Advertisement
Advertisement