Sichanov

everest

Apr 22nd, 2021 (edited)
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. command = input()
  2.  
  3. count_days = 1
  4. climbed_meters = 5364
  5. has_failed = False
  6. while command != "END":
  7.     sleep = command
  8.     meters_per_day = int(input())
  9.     if count_days < 5:
  10.         if sleep == "Yes":
  11.             count_days += 1
  12.             climbed_meters += meters_per_day
  13.         elif sleep == "No":
  14.             climbed_meters += meters_per_day
  15.     else:
  16.         has_failed = True
  17.         break
  18.     if climbed_meters >= 8848:
  19.         break
  20.     command = input()
  21.  
  22. if has_failed or command == 'END':
  23.     print("Failed!")
  24.     print(climbed_meters)
  25. else:
  26.     print(f"Goal reached for {count_days} days!")
Add Comment
Please, Sign In to add comment