名称'dead1'未定义

时间:2015-09-30 20:37:29

标签: python

这是我的代码中的一小部分无法正常工作,我和很多朋友似乎无法解决此错误

hours_1 = int(input("how many hours do you want to work per day (must be a whole number)the amount of hours you work will ressult in death"))
if hours_1 > 24 :
    print("you are attempting to work and impossible amount of hours")
if hours_1 <= 1:
    print("you are attempting to work and impossible amount of hours")
dead1 = int(10/ hours1)

我真的很感激一些帮助,因为我现在花了几个小时试图解决这个问题。

1 个答案:

答案 0 :(得分:1)

您似乎错过了变量的下划线。希望这会有所帮助。

dead1 = int(10/ hours1)
**dead1 = int(10/ hours_1)**