ElenaSokol

Untitled

Oct 25th, 2021
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. counter_days = 1
  2. climbed_meters = 5364
  3. reached_goal = False
  4. command = input()
  5. current_climbed_meters = int(input())
  6. while command != 'END':
  7.  
  8.     if command == 'Yes':
  9.         counter_days += 1
  10.         climbed_meters += current_climbed_meters
  11.         continue
  12.     elif command == 'No':
  13.         counter_days += 0
  14.         climbed_meters += current_climbed_meters
  15.         continue
  16.     if counter_days > 5:
  17.         break
  18.     if climbed_meters == 8848:
  19.         reached_goal = True
  20.         break
  21.     command = input()
  22.     current_climbed_meters = int(input())
  23.  
  24. if reached_goal:
  25.     print(f"Goal reached for {counter_days} days!")
  26. else:
  27.     print(f"Failed!")
  28.     print(f"{climbed_meters}")
  29.  
  30.  
  31.  
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment