i’m new to python and had trouble doing my assignment which i need to do a court rental system, particularly the last calculation for the total amount needed to pay. i need to consider types of court, membership, day and duration based on the table below
No | Court | Duration | Weekday | Weekday | Weekend | Weekend |
---|---|---|---|---|---|---|
— | — | — | Member | Public | Member | Public |
1 | Soccer | 1 Hour | 50 | 60 | 50 | 80 |
2 | Archery | 1 Hour | 20 | 35 | 25 | 55 |
3 | Basketball | 1 Hour | 55 | 65 | 55 | 85 |
2 | Badminton | 1 Hour | 30 | 60 | 35 | 65 |
the last output should be like this:
Rental Details
Court:
Rynx Member:
Day:
Hours:
Total amount you need to pay: $
i have done the code for every part (i still want to simplify the code, it’s too long) except for the total amount. this is my code:
#title
def opening():
print("""Welcome to Rynx Sports Complex Court Rental System
List of Courts
1. Soccer
2. Archery
3. Basketball
4. Badminton""")
opening()
#choose court
while True:
try:
select_court = int(input("nPlease select the court you would like to book by inserting the relevant number: "))
if select_court == 1:
print("You inserted number 1, Soccer.")
break
elif select_court == 2:
print( "You inserted number 2, Archery.")
break
elif select_court == 3:
print("You inserted number 3, Basketball.")
break
elif select_court == 4:
print("You inserted number 4, Badminton.")
break
else:
print("Re-enter the correct court number")
except ValueError:
print("Re-enter the correct court number")
#rynx member/public
customer_category = input("nAre you Rynx Member? (Type Yes or No): ")
def check_customer_category(customer_category):
if customer_category == "yes" or customer_category == "Yes" or customer_category == "YES":
print("You choose Member as option")
else:
print("You choose Public as option")
#day booked
day_booked = input("nWhen would you like to book the court? Mention the day only: ")
def check_day_booked(day_booked):
if day_booked == "monday" or day_booked == "Monday" or day_booked == "MONDAY":
print("You chose Monday as option")
elif day_booked == "tuesday" or day_booked == "Tuesday" or day_booked == "TUESDAY":
print("You chose Tuesday as option")
elif day_booked == "wednesday" or day_booked == "Wednesday" or day_booked == "WEDNESDAY":
print("You chose Wednesday as option")
elif day_booked == "thursday" or day_booked == "Thursday" or day_booked == "THURSDAY":
print("You chose Thursday as option")
elif day_booked == "friday" or day_booked == "Friday" or day_booked == "FRIDAY":
print("You chose Friday as option")
elif day_booked == "saturday" or day_booked == "Saturday" or day_booked == "SATURDAY":
print("You chose Saturday as option")
else:
print("You chose Sunday as option")
check_day_booked(day_booked)
i would appreciate it if someone could help me. thank you in advance