write a Python program to generate Fibonacci series till 10 terms using tuple
Answers
Answered by
3
def make_fibonacci(n):
fib = []
a, b = 0, 1
for i in range(n):
a, b = b, a+b
fib.append(a)
return tuple(fib)
make_fibonacci(8)
Answered by
0
Answer:
Fibonacci series can be found by assigning a variable a = 0 and b = 1. We will be printing a and changing the value of a = b and b = a + b.
n = int( input() )
a = 0
b = 1
i = 0
if ( i ! = 1 or i ! = 0 ) :
while ( i < = n ) :
print ( a ) ; a = b ; b = a + b ; i ++
else :
print( a ) ; print ( b ) ;
Why is python better than c
https://brainly.in/question/7706565
Similar Problem
https://brainly.in/question/6607456
#SPJ2
Similar questions
Chemistry,
2 months ago
Social Sciences,
2 months ago
Environmental Sciences,
4 months ago
Science,
4 months ago
Math,
10 months ago
Math,
10 months ago