from math import * Vy = 50 Vx = 50 # m/s G = 9.8 # m/s^2 Py = 3 Px = 0 timestep = .001 time = 0 while Py > 0: # Move the pumpkin along (change position) Py += Vy * timestep Px += Vx * timestep # Update Velocity Vy -= G * timestep # Vx would change if we added drag # Go on to the next timestep time += timestep print("Results of simulation: ") print("Distance: ", Px) print("Time Aloft: ", time) print("Impact velocity: ", sqrt(Vx**2 + Vy**2))