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
Losing hearts
1 Votes
Someone explain it... Plz!!!
1 Votes
Question â
0 Votes
Programming
0 Votes
Code suggestions
1 Votes
Web development
0 Votes
Help me
0 Votes
Sololearn Theme Changing
0 Votes