Skip to content

moroniq/fibonacci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

# Fibonacci Sequence (Recursive)

This simple Python notebook generates Fibonacci numbers using a recursive function.

## πŸ’‘ Project Description

The user enters a number, and the program calculates either:

- the Fibonacci number at that position (Nth number), or

- a sequence of Fibonacci numbers up to that position.

The recursive function is implemented in pure Python and handles invalid input (e.g. negative numbers).

## πŸ“‚ What's Included

- Recursive fibonacci(n) function

- Example outputs for selected numbers

- Loop that prints the first 10 Fibonacci numbers

## 🧠 Concepts Used

- Recursion

- Basic conditional logic

- Loops

- String formatting with f""

## πŸ›  How to Use

1. Clone or download this repository.

2. Open the notebook (fibonacci\_final.ipynb) in Jupyter Notebook or VS Code.

3. Run the cells to see example outputs or experiment with your own input.

## πŸ“ˆ Sample Output

Fibonacci(1) = 1

Fibonacci(2) = 1

Fibonacci(3) = 2

Fibonacci(4) = 3

Fibonacci(5) = 5

Fibonacci(6) = 8

Fibonacci(7) = 13

Fibonacci(8) = 21

Fibonacci(9) = 34

Fibonacci(10) = 55

## πŸš€ Next Steps

- Add an iterative version for better performance.

- Implement memoization for large inputs.

- Visualize the growth of the Fibonacci sequence.


Created with ❀️ by Olga.

About

πŸŒ€ Python program to generate the Fibonacci sequence up to a given number or Nth term.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published