try except example

This commit is contained in:
Mert Gör 🇹🇷 2023-08-12 18:09:56 +03:00
parent f7c8912b2a
commit d262380b86
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9

View File

@ -0,0 +1,7 @@
try:
s = input('Bir değer giriniz:')
x = int(s)
print(x)
except ValueError:
print('Girilen değer geçersiz!')
print('Program sonlanıyor...')