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