
Asked in Tcg Digital Solutions
Write code to print the first 10 elements of the Fibonacci series.

AnswerBot
2y
Code to print first 10 elements of Fibonacci series.
Declare variables for first two numbers of the series
Use a loop to generate the next numbers in the series
Print the first 10 numbers of the series

PrepInsta
3y
def Fibo(n):
f1 = 0
f2 = 1
if (n < 1):
return
print(f1, end=" ")
for x in range(1, n):
print(f2, end=" ")
next = f1 + f2
f1 = f2
f2 = next
fibo(10)
Help your peers!
Add answer anonymously...
Interview Questions from Popular Companies

3.7
• 8.7k Interviews

4.0
• 5.4k Interviews

3.5
• 4.2k Interviews

3.6
• 7.9k Interviews

3.7
• 5.9k Interviews

3.7
• 6.1k Interviews

3.5
• 4.2k Interviews

3.7
• 5.1k Interviews
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

