Fibonacci (Number)


Real Lab Procedure

  1. The integer variable "n" indicates the number of terms required in the Fibonacci sequence. 
  2. Take integer variables "current_term", "next_term" and "new_term". 
  3. Set current_term = 0 and next_term = 1. 
  4. If the input is greater than 1 then, display values for " current_term " and " next_term ". 
  5. new_term = current_term + next_term. 
  6. Print " next_term ". 
  7. Set  current_term = next_term and next_term = new_term. 
  8. Repeat steps 4 to 6, for "n" times. 

Simulator Procedure

  • Enter the input values. 
  • Click on the Submit button. 
  • Select the variables from the dropdown list.
  • Click on the Finish button or Start button to view the state diagram.
  • If you have clicked on the Start button, then use the Next and Previous buttons to view the state diagram.
  • Click on the Reset button when the State diagram is completed.



The program provided is a simple Python script that should run on a variety of systems with minimal hardware and software requirements. 

Hardware Requirements

Computer: Any modern computer capable of running Python. 

Input Devices: Keyboard (for entering input). 

Software Requirements

 Python: Python 3.0.x or newer. 

Code Editor or IDE: PyCharm 2023.3 or above / Atom 1.57.0 or above / IDLE 3.13 or newer.