-1
hours = input("Enter Hours:")

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

Error:

NameError: name 'x' is not defined 
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343

1 Answers1

3

input tries to interpret what you provided. Use raw_input.

Karoly Horvath
  • 94,607
  • 11
  • 117
  • 176