语法错误帮助 - 初学者级别

时间:2017-09-08 09:45:05

标签: python python-3.x if-statement python-import

这是我正在编写的一个小作业代码。当我在命令提示符下运行代码时,它不是要求我输入任何内容,而是在第8行显示语法错误

import math
t = 0  
h = 1000
u = 0
f = 1000
while h > 0:
    burnt_fuel = input("Enter fuel to burn in the next second")
    if burnt_fuel >= 0:
        h = h - (u - 0.5*(1.6-(burnt_fuel*0.15))
        t = t + 1
        u = u + a
        f = f - burnt_fuel

1 个答案:

答案 0 :(得分:1)

h = h - (u - 0.5*(1.6-(burnt_fuel*0.15))

你错过了结束) 它应该是: h = h - (u - 0.5*(1.6-(burnt_fuel*0.15)))