^
operator in t^2
is a bit-wise XOR operator.
>>> 3 ^ 3
0
If you intended the power operator, use **
instead.
>>> 3 ** 3
27
Question
I am simply trying to figure out the position based with a varying t and a vaying v_0.
What is wrong with this short program here?
#Position from Simple Equation
t = input('Time (in seconds)')
g = 9.81
v_0 = input('initial velocity')
s=-0.5*g*t^2 + v_0*t
print s
Thanks for the help guys.
La solution
^
operator in t^2
is a bit-wise XOR operator.
>>> 3 ^ 3
0
If you intended the power operator, use **
instead.
>>> 3 ** 3
27