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
Vote Code
1 Votes
Script file names
0 Votes
Without degree job
0 Votes
Hello World!
0 Votes
Html learn
1 Votes
Java doubt coders
0 Votes