Ask coding questions

← Back to all posts
How to add warning to your python REPL?
lzk (0)

Hello! I wanna know how to add a warning to your repl because I forgot, thanks!

Answered by 19ecal (230) [earned 5 cycles]
View Answer
lzk (0)
19ecal (230)

What do you mean by that?
If you want to make a custom error, you can do this

class MyCustomError(Exception): pass

You can then raise MyCustomError and catch it with try/except