Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import ceil
- count_days = int(input())
- count_km_first_day = float(input())
- check_count_days = count_days
- total_km = count_km_first_day
- total = count_km_first_day
- while check_count_days:
- percent_up = int(input())
- percent = percent_up / 100
- total_km = total_km + total_km * percent
- total += total_km
- # print(total_km)
- # print(total)
- check_count_days -= 1
- #total = round(ceil(total))
- diff = abs(total - 1000)
- diff_ceil = ceil(diff)
- if total >= 1000:
- print(f"You've done a great job running {diff_ceil} more kilometers!")
- elif total < 1000:
- print(f"Sorry Mrs. Ivanova, you need to run {diff_ceil} more kilometers")
Add Comment
Please, Sign In to add comment