Q&A Discussions
If except can handle common errors very well, doesn't that make the use of raise redundant inside of a try-except block?
For example:
try:
print( 5 / 0 )
except ZeroDivisionError:
raise ValueError("An error occurred!")
What's the difference if we handle it this way:
try:
print( 5 / 0 )
except (ZeroDivisionError, ValueError):
print("An error occurred!")
3 Votes
2 AnswersHot today
Why's there an error
2 Votes
Hello people
2 Votes
Machine learning
0 Votes
Just simple question
0 Votes
Ideas
1 Votes
How to 2
0 Votes
Html
0 Votes
How to start learning DBMS?
0 Votes
Is a refund possible?
1 Votes