Python除了错误

时间:2015-11-30 11:35:03

标签: python python-2.7

hours = input("Enter Hours:")

try:
   value = float(hours)
    print value
except:    
    print "Please enter a number"

错误:

NameError: name 'x' is not defined 

1 个答案:

答案 0 :(得分:3)

input试图解释您提供的内容。使用raw_input