1/2 * p * Cd * math.pi * r**2 * v**2
If you want to run it on Python 2, either change the 1/2 in the drag function to 1./2 or 0.5, or add
from __future__ import division
If you want to run it on Python 2, either change the 1/2 in the drag function to 1./2 or 0.5, or add
at the top to tell Python 2 you want to use the Python 3 division behavior.