> For the complete documentation index, see [llms.txt](https://yu-sun.gitbook.io/essential-git-for-scientists/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yu-sun.gitbook.io/essential-git-for-scientists/exercise/exercise-1.md).

# Exercise 1

> **Fibonacci sequence**
>
> 1, 1, 2, 3, 5, 8, ..... It starts with 1, 1. The n-th item $$F\_n$$ is given using the following equation:
>
> $$F\_n = F\_{n-1} + F\_{n-2}$$

* Initiate an empty repo;
* Show all branches;
* Define a function named `fib()` in a new file `make_fibo.py`
  * It takes an argument n and returns the first n items of the Fibonacci sequence (without using recursion).
  * Make a commit;
  * Show all branches;
* Make a new branch called `feature`;
  * Show all branches;
* Switch to the `feature` branch;
  * Show all branches;
  * Observe any difference from the previous one;
* Add a new file called `make_fibo_recur.py`;
  * Implement the `fib()` using recursion;
  * Make a commit;
* Switch to the master branch;
* Rename the `feature` branch to `new-branch`;
  * Show all branches;
* Try delete the `new-branch`;
  * Merge the `new-branch` into master;
  * Try delete the `new-branch`;
* Show all branches;

##
