Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wpforms-lite domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/ragipunal.com/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the businext domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/ragipunal.com/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the businext domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/ragipunal.com/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/ragipunal.com/wp-includes/functions.php on line 6114
Python break Deyimi - RAGIP ÜNAL

Blog

Python break Deyimi

Python programları içinde ki bir döngü yapısı içinden, döngüyü kontrol eden koşul ifadesini beklemeksizin hemen döngü dışına çıkmak amacıyla kullanılır. Break deyimi bir döngüde yer almışsa bu durumda break deyimi ile karşılaşır karşılaşmaz çevrim dışına çıkılır ve döngüyü izleyen deyime geçilir.

Program:

toplam=0
miktar=0
print("Sayı girişine son vermek için negaztif tam sayı giriniz")
while True:
    say=input("Sayı...")
    say=int(say)
    if say <0: break
    toplam+=say
    miktar+=1
ort=toplam/miktar
print("Sayıların Toplamı=", toplam)
print("Sayıların Ortalaması=", ort)
print("Girilen Sayı Miktarı", miktar)

Çıktı:

Sayı girişine son vermek için negaztif tam sayı giriniz
Sayı...10
Sayı...20
Sayı...30
Sayı...40
Sayı...-10
Sayıların Toplamı= 100
Sayıların Ortalaması= 25.0
Girilen Sayı Miktarı 4

017_while_break.py

Leave A Comment

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir