Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command = input()
- count_days = 1
- climbed_meters = 5364
- has_failed = False
- while command != "END":
- sleep = command
- meters_per_day = int(input())
- if count_days < 5:
- if sleep == "Yes":
- count_days += 1
- climbed_meters += meters_per_day
- elif sleep == "No":
- climbed_meters += meters_per_day
- else:
- has_failed = True
- break
- if climbed_meters >= 8848:
- break
- command = input()
- if has_failed or command == 'END':
- print("Failed!")
- print(climbed_meters)
- else:
- print(f"Goal reached for {count_days} days!")
Add Comment
Please, Sign In to add comment