Merge pull request #1 from damoklov/damoklov-patch-1

Added useful Python file for checking input data
This commit is contained in:
damoklov
2018-10-06 23:33:58 +03:00
committed by GitHub

14
code/try_except.py Normal file
View File

@@ -0,0 +1,14 @@
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