exception example 6

This commit is contained in:
Mert Gör ☭ 2023-08-20 14:28:49 +03:00
parent 275275a5db
commit eae541298b
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
1 changed files with 9 additions and 0 deletions

View File

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