Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Create holiday_camp procedure to print the camp name
- def holiday_camp():
- print("Tane's School Holiday Camp")
- print("These are the activities and costs")
- print("")
- # Print the camp name at the start
- holiday_camp()
- camp_details_list_tuple = [
- ("Cultural immersion", "easy", 800, "5"),
- ("Kayaking & pancakes", "moderate", 400, "3"),
- ("Mountain biking", "difficult", 900, "4")
- ]
- # Loop through camp details and print them
- loop_count = 0
- while loop_count < len(camp_details_list_tuple):
- print(f"{loop_count} {camp_details_list_tuple[loop_count][0]} {camp_details_list_tuple[loop_count][3]} days {camp_details_list_tuple[loop_count][1]} {camp_details_list_tuple[loop_count][2]}")
- loop_count += 1
- # Ask for name
- name = ""
- while name == "":
- name = input("What is your name? ")
- if name == "":
- print("Please enter your name - You cannot leave it blank.")
- print("")
- # Ask for age
- age = 99
- while age < 5 or age > 17:
- if age != 99:
- print("Your age must be between 5 and 17 to attend the camp. Please enter a valid age")
- age = int(input("What is your age? "))
- # Ask what camp the user wants to attend
- activity_number = int(input("What number camp do you want to go to? "))
- # Ask what meal the user wants
- camp_meal = input("What meal do you want: standard, vegetarian, or vegan? ").lower()
- # Ask if the user needs the shuttle bus
- shuttle_bus = 80
- shuttle_bus_question = input("Do you need the shuttle bus - extra $80? ").lower()
- # Calculate total cost
- camp_cost = camp_details_list_tuple[activity_number][2]
- if shuttle_bus_question == "yes" or shuttle_bus_question == "y":
- total_cost = camp_cost + shuttle_bus
- else:
- total_cost = camp_cost
- # Output confirmation
- print(f"Hello {name}, you are {age}. It lasts {camp_details_list_tuple[activity_number][3]} days, going to {camp_details_list_tuple[activity_number][0]} which is {camp_details_list_tuple[activity_number][1]}, your meal is {camp_meal}.")
- print(f"Please confirm you want to go with the cost of {total_cost}.")
- print("Enjoy the camp!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement