#quote from MIT 'introduction to computation and programming using python, Revised'
while True:
val = raw_input('Enter an integer: ')
try:
val = int(val)
print 'The square of the number you entered is', val**2
break #to exit the while loop
except ValueError:
print val, 'is not an integer'
%run "C:\Users\Administrator\test.py"
Enter an integer: 12.0
12.0 is not an integer
Enter an integer: hello
hello is not an integer
Enter an integer: 11
The square of the number you entered is 121