Skip to content

Commit f31b613

Browse files
committed
add exception tutorial
1 parent b0b1850 commit f31b613

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

python-tutorials/except_tuto.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#Defina exceptions customizadas em Python
2+
3+
class MyException(Exception):
4+
pass
5+
6+
raise MyException("Minha condição de erro")
7+
8+
#Result
9+
10+
# raise MyException("Minha condição de erro")
11+
#__main__.MyException: Minha condição de erro

0 commit comments

Comments
 (0)