永发信息网

我编的这个python程序为什么只能运行第一步?如何让其全部运行?

答案:2  悬赏:10  手机版
解决时间 2021-01-02 22:52
  • 提问者网友:嘚啵嘚啵
  • 2021-01-02 04:24
这是一个牛顿定律的运算程序
# Get the initial position value.
initial_x_position = float(input('Enter the initial position value: 7.62'))

# Get the initial velocity value.
initial_v = float(input('Enter the initial velocity value: 5.56'))

# Get the value of acceleration.
a = float(input('Enter the acceleration value: 12.7'))

# Get the value of time.
t = float(input('Enter the time value: 4.5'))

# Calculate the final position value.
final_x_position = initial_x_position + initial_v * t + 0.5 * a * (t ** 2)

# Display the value of fianl position
print('You will get the final position value:',final_x_position)
运行时只能进行第一步
最佳答案
  • 五星知识达人网友:第四晚心情
  • 2021-01-02 05:59
# Get the initial position value.
initial_x_position = float(input('Enter the initial position value: 7.62\n'))

# Get the initial velocity value.
initial_v = float(input('Enter the initial velocity value: 5.56\n'))

# Get the value of acceleration.
a = float(input('Enter the acceleration value: 12.7\n'))

# Get the value of time.
t = float(input('Enter the time value: 4.5\n'))

# Calculate the final position value.
final_x_position = initial_x_position + initial_v * t + 0.5 * a * (t ** 2)

# Display the value of fianl position
print('You will get the final position value:',final_x_position)你需要输入一个数字继续下一步,比如出现“Enter the initial position value: 7.62
”你就输入7.62然后回车
全部回答
  • 1楼网友:像个废品
  • 2021-01-02 07:28

时间不多,我先回答第三题

#3 def recursive(strg):     if len(strg)==1:     return strg     else:     s=''     for e in strg:     s=e+s     return s

def main():     fname= raw_input("enter a string:")     print 'the reverse of %s is %s'%(fname,recursive(fname))

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯