BbJLeB

04. Everest

May 17th, 2019
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. # 04. Everest
  2. countDays = 1
  3. attitudeReached = 5364
  4. attitudeEverest = 8848
  5. command = input()
  6. metersClimbed = 0
  7. while True:
  8.     if command == "END":
  9.         break
  10.     elif command == "Yes":
  11.         countDays += 1
  12.     if countDays > 5:
  13.         break
  14.     metersClimbed = int(input())
  15.     attitudeReached += metersClimbed
  16.     if attitudeReached >= attitudeEverest:
  17.         break
  18.     command = input()
  19. if attitudeReached >= attitudeEverest:
  20.     print(f"Goal reached for {countDays} days!")
  21. else:
  22.     print(f"Failed!")
  23.     print(f"{attitudeReached}")
Advertisement
Add Comment
Please, Sign In to add comment