generate functionThu, 02 Mar 2023

(To use a while loop). Having started training, the skier ran 10 km on the first day. Each next day, he increased the run by 10% of the previous day's run. Determine on which day he will run more than x km (a natural number x is entered from the keyboard). The result (the desired day) is displayed on the screen.

def run(x): day = 1 run = 10 while run < x: run += run * 0.1 day += 1 return day run(int(input()))

Questions about programming?Chat with your personal AI assistant