Advertisement
ALEXANDAR_GEORGIEV

ddd

Jun 18th, 2022
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. from math import ceil
  2. count_days = int(input())
  3. count_km_first_day = float(input())
  4. check_count_days = count_days
  5. total_km = count_km_first_day
  6. total = count_km_first_day
  7. while check_count_days:
  8.     percent_up = int(input())
  9.     percent = percent_up / 100
  10.     total_km = total_km + total_km * percent
  11.     total += total_km
  12.     # print(total_km)
  13.     # print(total)
  14.  
  15.     check_count_days -= 1
  16.  
  17. total = round(ceil(total))
  18. if total >= 1000:
  19.     print(f"You've done a great job running {(total - 1000)} more kilometers!")
  20. elif total < 1000:
  21.     print(f"Sorry Mrs. Ivanova, you need to run {(1000 - total)} more kilometers")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement