exception example 12

This commit is contained in:
Mert Gör ☭ 2023-08-22 12:09:54 +03:00
parent 446f896752
commit aa1eb420ad
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,13 @@
def foo():
print('foo begins...')
try:
while True:
a = int(input('Bir değer giriniz:'))
if a == 0:
return
print(a * a)
except:
print('Exception oluştu!..')
finally:
print('finally!..')
foo()

View File

@ -0,0 +1,12 @@
def foo():
print('foo begins...')
try:
while True:
a = int(input('Bir değer giriniz:'))
if a == 0:
return
print(a * a)
except:
print('Exception oluştu!..')
finally:
print('finally!..')