try statement with input : Raw_input : Buildin Function PYTHON TUTORIALS


PYTHON TUTORIALS » Buildin Function » Raw_input »

 

try statement with input


user_input = raw_input("Enter an integer: ")

try:
    number = int(user_input)
    print "You entered", number
except ValueError:
    print "Integers, please!"



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Buildin Function
» Raw_input