exception example 6
This commit is contained in:
parent
275275a5db
commit
eae541298b
9
python-temel/exception.example.6.py
Normal file
9
python-temel/exception.example.6.py
Normal 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')
|
Loading…
Reference in New Issue
Block a user