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 While Döngüsüyle Faktöryel Hesaplama - RAGIP ÜNAL

Blog

Python While Döngüsüyle Faktöryel Hesaplama

Aşağıdaki programda, faktöryel hesaplanmakta ve hesaplanan faktöryelin değeri 5040’ı aştığında döngü durmaktadır ve sonucu ekrana yazmaktadır. Bu şekilde bilgisayarda hesaplanan bir ifadenin değerini kontrol edilerek verilen koşula göre durdurulduğu  uygulamalarda while döngüsünü kullanmış olacağız.

Program:

fakt=1
i=2
while fakt<5040:
    print("i=", i)
    fakt*=i
    i += 1
print("Faktöriyel=", fakt)

Çıktı:

i= 2
i= 3
i= 4
i= 5
i= 6
i= 7
Faktöriyel= 5040

007_while.py

Leave A Comment

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