I'm working on an assignment where we have to run a simulation for a model rocket. I am given the formula for the position of the rocket and my assignment is to run the simulation until the model rocket returns back to earth and print the distance of the rocket for each second of flight.
The user will input it's initial velocity, which will randomize as to how long the rocket will be in flight. I'm having trouble as to how to stop the loop once the rocket reaches the earth again (0 ft). I've been using a while loop:
while not position == 0:
Which results in an infinite loop. Is there another solution for this?