exception example 5

This commit is contained in:
Mert Gör ☭ 2023-08-19 23:09:52 +03:00
parent c90b4be4b1
commit 275275a5db
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
1 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,10 @@
try:
val = int(input('Bir değer giriniz:'))
print(val * val)
except TypeError:
print('Girilen değerin türü uygun değil!')
except:
print('Diğer bir nedenden dolayı exception oluştu')
else:
print('else bölümü yalnızca exception oluşmadığı zaman çalıştırılır...')
print('Bu deyim her zaman çalıştırılacaktır')