python-CSD-kursu/python-temel/exception.example.4.py

8 lines
206 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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')