sievrebo

Everest

May 18th, 2019
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. command = input()
  2.  
  3. goal_height = 8848
  4. goal_days = 5
  5. count_days = 1
  6. current_height = 5364
  7.  
  8. while command != "END" and count_days < 5 and current_height < goal_height:
  9.     climbed_height = int(input())
  10.     if command == "Yes":
  11.         count_days += 1
  12.         current_height += climbed_height
  13.     elif command == "No":
  14.         current_height += climbed_height
  15.     if count_days == goal_days:
  16.         break
  17.     if current_height >= goal_height:
  18.         break
  19.     command = input()
  20. if current_height >= goal_height:
  21.     print(f"Goal reached for {count_days} days!")
  22. else:
  23.     print(f"Failed!\n{current_height}")
Advertisement
Add Comment
Please, Sign In to add comment