Q&A DiscussÔes
try-except & Boolean
1 Voto
3 RespostasPython
0 Voto
5 RespostasIf 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 Votos
2 RespostasQuente hoje
SQL
3 Votes
HTML/CSS questions
0 Votes
JAVA PROGRAMMING
2 Votes
What Does Pseudo Elements Mean.
2 Votes
IMAGE
0 Votes
Html
1 Votes
Find courses
0 Votes