Ask coding questions

← Back to all posts
How to create error message ?
JordanMartinez1 (0)

My task is to create an "error" message when the beginning value is larger than the end value. I did the majority of this task, I just need to find a way to create that error message.

Comments
hotnewtop
Wumi4 (531)

You can use something like ValueError for this.

# Raise ValueError with a custom message
raise ValueError("ValueError")

You can google python errors for more about this.