-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
你是什么意思? –