Dyskusje Q&A
OMG! this is, well, Hard!
3 głosów
5 odpowiedzi[SOLVED] Problem w/ RobotBarman
-2 głosów
2 odpowiedziIf 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 głosów
2 odpowiedziPopularne dzisiaj
Using Python on VScode
2 Votes
Python Developer
0 Votes
fully dynamic arrays
1 Votes
Wayss
0 Votes
Hearts
0 Votes
Project subjection
0 Votes