Function example: scope is important inside function, only knows about parameters passed and what is inside does not see outside variables! Ball tossed upward, how long is it in flight? what is max height? define g, initial velocity, t, dt set initial position as zero (tossed from ground) initialize max height to zero while postion > 0 set acceleration update velocity update position add dt to time elapsed is the current height more than the stored maximum? if so, current height is now max height now the ball is back on the ground. what is total time, and what was max height? Adding air resistance acceleration due to air resistance is -b*v**2 v is current velocity, b is a positive constant !! always in the direction opposite velocity updating acceleration, with +x upward: if v is positive, a = -g - b*v**2 if v is negative, a = -g + b*v**2 if v is zero, a = -g Finding terminal velocity new condition: when current velocity - previous velocity is zero (no change in v) is the absolute value of (v-v_prev) > 0? if so, keep going initialize v_prev to anything different than initial velocity so that starting value of (v-v_prev) != 0 before updating velocity in the loop, update v_prev = v then update velocity How does terminal velocity vary with b? for b = 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, make a plot (excel) turn this plot in Can you make the terminal velocity thing into a function to make the previous part easier? for b in range ... execute function and print result e.g., for i in range(1,10): find v terminal print it b = b + 0.1 this does it for 10 values of b