hacktoberfest-2018/code/try_except.py

15 lines
285 B
Python
Raw Normal View History

while True:
line = input()
if line:
try:
a = int(line)
print("Correct!")
exit(0)
except ValueError as vr:
print("Value Error:",vr)
continue
else:
print("Enter something")
continue