Hi I am new to Python.
Suppose an app is accepting input then how do I validate that it is integer or not ?
Suppose an app is accepting input then how do I validate that it is integer or not ?
a = raw_input('Enter an integer: ')
try:
a=int(a)
except:
print 'Please enter a valid integer'
exit(1)
print 'You entered:', a