Advertisement
7f

fixmycode-1

7f
Jul 1st, 2024
766
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.53 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. if 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.     elif leader_question == "no" or leader_question == "n":
  39.         print("Someone else will be chosen to be the camp leader.")
  40.     else:
  41.         print("Sorry, i was looking for a yes/y or no/n answer.")
  42.  
  43.  
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement