This folder python_recursion, is an exploration of recursion using Python 3.6.7. There are seven exercises, one per Jupyter Notebook file. The format of each file is as follows: an iterative function, a recursive function, and tests to ensure both functions perform correctly.
There are seven exercises. Below, are the folders and a brief summary of each. Each file has an ipynb file, an executable .py file, and a test file (unit tests).
01_SumOfListFind the sum of a list.02_CounterOfListFind the number of members in a list.03_MaxOfListFind the maximum value of a list.04_MinOfListFind the minimum value of a list.05_FibonacciSequenceFind the ith number of a Fibonacci Sequence.06_FactorialFind the factorial of a number.07_DoublingNumbersFind the sum of doubled numbers in range of numbers.
- open a terminal/bash window. Pull the files to the desktop:
git clone https://github.com/knishina/python_recursion.git - cd into the file you would like to explore.
- type
python <filename>.pyto run. - type
pytestto run the unit tests of the .py
- if it does not run, type inpip install -U pytest
This project is licensed under the MIT License - see the LICENSE.md file for details.