how to print fibonacci series using while loop in python?
pls don't spam, tell only correct answers
Answers
Answered by
1
Answer:
Fibonacci Series In Python | Python Program To Print Fibonacci...
- INPUT FORMAT: Input consists of an integer.
- OUTPATIEN FORMAT:
- SAMPLE INPUT: 7.
- SAMPLE OUTPUT: 0 1 1 2 3 5 8.
- PREREQUISITE KNOWLEDGE:while loop in Python and Recursion in Python.
- Step 1:Input the 'n' value until which the Fibonacci series has to be generated
- .Step 3:while (count <= n)
- Step 5:Increment the count variable.
Answered by
0
Answer:
While (0 < 4) is TRUE. So, Fibonacci Series program starts executing statements inside the while loop.
Within the while loop, we have If statement and the condition if (0 <= 1) is TRUE. So, Next = 0 and compiler exit from if statement block.
Print statement print(Next) print the value 0.
Lastly, i incremented to 1.
Similar questions