nick34992
8/7/2016 - 10:31 PM

Error Handling: Integer Entry

Error Handling: Integer Entry

#!/usr/bin/env python3

i = None
err = "Invalid entry!"
s = input("Enter any integer: ")
try:
    i = int(s)
    print("Valid integer", i, "was entered.")
except:
    print(err)