Skip to content

Commit 89aa001

Browse files
authored
Add details in python answer about error handling.
1 parent 66cb4de commit 89aa001

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3244,9 +3244,8 @@ If user enter a non-integer value it will raise exception and using except it wi
32443244
while True:
32453245
try:
32463246
a = int(input("please enter an integer value: "))
3247-
print(a)
32483247
break
3249-
except:
3248+
except ValueError:
32503249
print("Ops! Please enter a valid integer value.")
32513250

32523251
```

0 commit comments

Comments
 (0)