#fibonacciseries
HTML-код
- Опубликовано: 7 сен 2024
- Fibonacci Series for Tuples using Python Programming
Fibonacci Series: It is a sequence of numbers where each number is the sum of the two preceding ones.
Example: 0 1 1 2 3 5 8 13 --- and so on
Tuples are an immutable, ordered collection of elements. It can hold a sequence of items.
t1= (1,2,3) t2=(4,5,6)
t3= t1+t2
t3=(5,7,9) ---- and so on
The function of fibonacci series:
def fibo(n,t1,t2):
print(t1)
print(t2)
for i in range(n+1):
c=tuple(x+y for x,y in zip(t1,t2))
t1,t2=t2,c
print(c)
kindly like, share and subscribe to my channel
Great
Keep it up
Grt🎉
Nice