BbJLeB

test 2

May 17th, 2019
94
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.  
  3. countDays = 1
  4. attitudeReached = 5364
  5. attitudeEverest = 8848
  6. command = input()
  7. metersClimbed = 0
  8. while True:
  9.     if command == "END":
  10.         break
  11.     elif command == "Yes":
  12.         countDays += 1
  13.     if countDays > 5:
  14.         break
  15.     metersClimbed = int(input())
  16.     attitudeReached += metersClimbed
  17.     if attitudeReached >= attitudeEverest:
  18.         break
  19.     command = input()
  20. if attitudeReached >= attitudeEverest:
  21.     print(f"Goal reached for {countDays} days!")
  22. else:
  23.     print(f"Failed!")
  24.     print(f"{attitudeReached}")
Add Comment
Please, Sign In to add comment