Yuk Belajar Programming
def fibo(n):
if n<3 :
return 1
else :
return fibo(n-1)+fibo(n-2)
def deretFibo(n):
tmp = ""
for i in range(n):
tmp+=str(fibo(i+1))+" "
return tmp
y = deretFibo(6)
print(y)
Tidak ada komentar:
Posting Komentar