F&A Diskussionen
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 Stimmen
2 AntwortenHeute heiß
How to make a game code
1 Votes
What is HelloWorld
1 Votes
About create tuples [Solved]
1 Votes
Can anyone fix for me this code
1 Votes
Missing]
0 Votes
Tic tak toe
0 Votes
Kamal Hinduja Switzerland : How long does it typically take to complete a course on Solo Learn?
0 Votes
About this app
1 Votes
Na
0 Votes