0

私は単に、変化する t と変化する v_0 に基づいて位置を把握しようとしています。

ここでのこのショート プログラムの何が問題になっていますか?

#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

助けてくれてありがとう。

4

1 に答える 1

0

^ operator in t^2 is a bit-wise XOR operator.

>>> 3 ^ 3
0

If you intended the power operator, use ** instead.

>>> 3 ** 3
27
于 2014-02-24T08:02:34.990 に答える