break examples

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

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

@ -0,0 +1,8 @@
for i in range(5):
val = int(input('Bir değer giriniz:'))
if val == 0:
break
print(val * val)
else:
print('Döngü sonlandı')
print('Program sonlandı')

6
while.break.example.py Normal file
View File

@ -0,0 +1,6 @@
while True:
a = int(input("Değer giriniz:"))
if a == 0:
break
print(a * a)
print("program bitti")