Created
March 18, 2011 22:12
-
-
Save hnur/876949 to your computer and use it in GitHub Desktop.
verilen sınıra kadar olan fibonacci serisinin çift sayılarını toplar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = raw_input("sınır sayısını giriniz : ") | |
sinir = int(a) | |
def fibo_cift_toplam(): | |
fibo_list =[0, 1,] | |
for i in range(sinir): | |
yeni_fibo = fibo_list[i] + fibo_list[i + 1] | |
fibo_list.append(yeni_fibo) | |
print fibo_list | |
toplam = 0 | |
for i in range(sinir): | |
if fibo_list[i] % 2 == 0: | |
toplam = toplam + fibo_list[i] | |
print sinir, "' a kadar olan çift fibonaci elemanlarının toplamaı = ", toplam | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment