Advertisement
7f

fixmycode-2

7f
Jul 3rd, 2024
758
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.01 KB | None | 0 0
  1. #Create campname procedure to print the camp name
  2. def holiday_camp ():
  3.     print("Tane's School Holiday Camp")
  4.  
  5. #Print the camp name at the start
  6. holiday_camp()
  7.  
  8. camp_activities = ["Cultural immersion - Easy - $800 - 5 days",
  9.                    "Kayaking and pancakes - Moderate - $400 - 3 days",
  10.                    "Mountain biking - Difficult - $900 - 4 days"]
  11.  
  12. activity_number = 0
  13. while activity_number < 3 :
  14.     print(activity_number, camp_activities[activity_number])
  15.     activity_number = activity_number + 1
  16.  
  17. #Ask name and make sure it is not left blank
  18. name = ""
  19. while name == "":
  20.     name = input("What is your name? ")
  21.     if name == "":
  22.         print("Please enter your name - You cannot leave it blank.")
  23.         print("")
  24.  
  25. #Ask age and make sure it is not older than a camper can be
  26. age = 99
  27. while age < 5 or age > 17 :
  28.     if age != 99:
  29.         print("")
  30.         print("Your age must be between 5 and 17 to attend the camp. Please enter a valid age")
  31.     age = int(input("How old are you? "))
  32.    
  33. #Check if age is between 12 and 16 to ask leader question
  34. while age > 12 and age < 16:
  35.     leader_question = input("You are eligible to be the camp leader. Do you want to be the camp leader? ").lower()
  36.     if leader_question == "yes" or leader_question == "y":
  37.         print("You are now the camp leader.")
  38.         break
  39.     elif leader_question == "no" or leader_question == "n":
  40.         print("Someone else will be chosen to be the camp leader.")
  41.         break
  42.     else:
  43.         print("Sorry, i was looking for a yes/y or no/n answer.")
  44.  
  45. #Ask what activity to attend
  46. activity_number = input("What camp number to do want to attend? ")
  47. if activity_number == "0":
  48.     print("You have chosen to attend the Cultural Immersion camp.")
  49. elif activity_number == "1":
  50.     print("You have chosen to attend the Kayaking and Pancakes camp.")
  51. elif activity_number == "2":
  52.     print("You have chosen to attend the Mountain Biking camp.")
  53. else:
  54.     print("You must choose to attend a camp - you cannot leave this blank")
  55.  
  56. #Ask what meal to eat at the camp
  57. camp_meal = input("What meal selection would you like? Standard, vegeterian or vegan ")
  58. if camp_meal == "Standard" or camp_meal == "standard":
  59.     print("You will eat the standard meals at your camp")
  60. elif camp_meal == "Vegeterian" or "vegeterian":
  61.     print("You will eat the vegeterian meals at your camp")
  62. elif camp_meal == "Vegan" or "vegan":
  63.     print("You will eat the vegan meals at your camp")
  64. else:
  65.     print("You must choose a meal to eat while attending your camp - you cannot leave this blank ")
  66.  
  67. shuttle_bus = input("Do you need to take the shuttle bus to your camp? - extra $80 ")
  68. if shuttle_bus == "yes" or shuttle_bus == "y":
  69.     print("You will take the next shuttle bus to your camp")
  70. elif shuttle_bus == "no" or shuttle_bus == "n":
  71.     print("The next shuttle bus will leave without you")
  72. else:
  73.     print("You must decide - you cannot leave this blank")
  74.    
  75. print(f"hello {name} you are {age} and you have chosen {activity_number}")
  76.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement