more break examples
This commit is contained in:
parent
6b03924aa4
commit
278825e796
9
break.example.2.py
Normal file
9
break.example.2.py
Normal 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
8
break.example.3.py
Normal 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ı')
|
Loading…
Reference in New Issue
Block a user