A
A
AlexKor652020-09-01 22:43:04
Python
AlexKor65, 2020-09-01 22:43:04

Don't know how to solve a Python problem?

Help with a solution.
Write a program to help you create a training plan to prepare for a marathon. It receives as input the number of kilometers on the planned marathon, how many the user plans to run on the first day of training, and by what percentage he plans to increase this distance every day. At the output, the program should give out how many days the user will need to prepare to run the target number of kilometers.

Restriction: You cannot use the ceil() function from the math module and its analogues.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Naumov, 2020-09-01
@AlexKor65

length = 49.195

now = int(input())
percent = int(input()) / 100 + 1
days = 0

while now < length:
    days += 1
    now *= percent


print(days)

 Something like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question