more break examples

This commit is contained in:
Mert Gör 🇹🇷 2023-05-21 08:57:59 +03:00
parent 6b03924aa4
commit 278825e796
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
2 changed files with 17 additions and 0 deletions

9
break.example.2.py Normal file
View File

@ -0,0 +1,9 @@
a = [23, 45, 34, 67, 89, 34, 56, 11, 23, 45]
val = int(input('Aranacak sayıyı giriniz:'))
for i in a:
if i == val:
print('bulundu')
break
else:
print('bulunamadı')

8
break.example.3.py Normal file
View File

@ -0,0 +1,8 @@
a = [23, 45, 34, 67, 89, 34, 56, 11, 23, 45]
val = int(input('Aranacak sayıyı giriniz:'))
for i in a:
if i == val:
print('bulundu')
break
if i != val:
print('bulunamadı')