Advertisement
pacho_the_python

Untitled

Jun 24th, 2023
855
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. days = 1
  2. high = 5364
  3. goal_reached = False
  4. while True:
  5.     command = input()
  6.     if command == "END":
  7.         break
  8.     meters_claim = int(input())
  9.     if command == "Yes":
  10.         days += 1
  11.         high += meters_claim
  12.     if command == "No":
  13.         high += meters_claim
  14.     if days > 5:
  15.         high -= meters_claim
  16.         break
  17.     if high >= 8848:
  18.         goal_reached = True
  19.         break
  20.  
  21. if goal_reached:
  22.     print(f"Goal reached for {days} days!")
  23. else:
  24.     print("Failed!")
  25.     print(high)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement