Write a program to print a Fibonacci series.

AnswerBot
1y
Program to print Fibonacci series in Python
Initialize variables for first two numbers in the series (0 and 1)
Use a loop to calculate and print the next number by adding the previous two numbers
Continu...read more
Anonymous
author
1y
"""Using Python :"""
n=int(input("Enter the last number")
a=0
b=1
while(a<=n):
print(f"{a}",end=''")
c=a
a=b
b=b+c
print(",",end=" ")
Help your peers!
Add answer anonymously...
TCS Assistant System Engineer Trainee interview questions & answers
An Assistant System Engineer Trainee was asked 2w agoQ. What is exception handling?
An Assistant System Engineer Trainee was asked 2w agoQ. What is OOPS and what are its pillars?
An Assistant System Engineer Trainee was asked 1mo agoQ. What is the method to count the number of words in a given string?
Popular interview questions of Assistant System Engineer Trainee
An Assistant System Engineer Trainee was asked 1w agoQ1. Explain OOP concepts.
An Assistant System Engineer Trainee was asked 2w agoQ2. What is exception handling?
An Assistant System Engineer Trainee was asked 2w agoQ3. What is OOPS and what are its pillars?
Top HR questions asked in TCS Assistant System Engineer Trainee
An Assistant System Engineer Trainee was asked 1mo agoQ1. What will you do if you encounter any problem?
An Assistant System Engineer Trainee was asked 3mo agoQ2. Can you provide a brief introduction about yourself?
An Assistant System Engineer Trainee was asked 5mo agoQ3. Are you open to relocating for this position?
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

