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 Bir Arttırılarak Toplanıp, Girilen Sayıya Ulaşma - RAGIP ÜNAL

Blog

Python While Döngüsüyle Bir Arttırılarak Toplanıp, Girilen Sayıya Ulaşma

Aşağıda while yapısının sonlu döngü oluşturmak amacıyla, girilen n sayısına, toplayarak ulaşmaya çalışacağız.

1+2+3+…+n toplanılarak sonucu hesaplamak için aşağıdaki programı kullanacağız.

Program:

n=input("Üst Limit (n) ...")
n=int(n)
toplam=0
i=1
while i<=n:
    toplam+=i
    i+=1
print("1+2+3+...", n,"=", toplam )

Çıktı:

Üst Limit (n) ...10
1+2+3+... 10 = 55

Leave A Comment

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