Nowy kurs! Każdy programista powinien nauczyć się Generative AI!
Wypróbuj darmową lekcję0
Can someone explain what raise does?
1 Odpowiedź
+ 1
It gives you the ability to make a custom error and then raise it. It would be used in conjuction with a try/except statement.
Eg:
try:
print("Hi")
except:
raise MyError("Whoops!")