Q&A Discussões
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 Votos
2 RespostasCan you help me in this code?
-4 Votos
9 RespostasQuente hoje
Losing hearts
2 Votes
Someone explain it... Plz!!!
1 Votes
Code suggestions
3 Votes
Question ❓
0 Votes
Web development
0 Votes
Sololearn Theme Changing
0 Votes
Help me
0 Votes