-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
  • 963,270
  • 265
  • 3,804
  • 3,187

1 Answers1

3

input tries to interpret what you provided. Use raw_input.

Karoly Horvath
  • 91,854
  • 11
  • 113
  • 173