diff --git a/python-temel/exception.example.2.py b/python-temel/exception.example.2.py new file mode 100644 index 0000000..ec0f08c --- /dev/null +++ b/python-temel/exception.example.2.py @@ -0,0 +1,17 @@ +def foo(): + print('foo begins...') + bar() + print('foo ends...') + +def bar(): + print('bar begins...') + int('xxx') # ValueError + print('bar ends...') + +try: + foo() +except (ValueError, TypeError): + print("ValueError ya da TypeError exception'ı oluştu") +except IndexError: + print("IndexErrorexception'ı oluştu") +print('ends...')