-5
# Kinematics clculator
print('Kinematics Calculator')
print('If either one of the three values(s,v,t) is not given then put its value = 1')
s = float(input('Enter your distance = '))
print(s)
t = float(input('Enter your time = '))
print(t)
v = float(input('Enter your velocity = '))
print(v)
if 'v == 1' :
print('velocity = '+ str(s/t))
elif 't == 1' :
print('time = '+ str(s/v))
else :
's == 1'
print('distance = '+ str(v*t))
幫我改正這段代碼。每當我嘗試計算什麼比別的「速度」它總是使用第一個打印命令即如何在Python中調試我的if和elif語句?
print('velocity = '+ str(s/t))
你應該縮進它'打印('速度= '+ STR(S/T))'' –
' V == 1''和兄弟姐妹_strings_。 – ForceBru
你是什麼意思? –