Python Problem Solving
- Problem 1: Prints key along with it's depth of a dictionary. file name: depth_dict.py
- Problem 2: Prints key along with it's depth of a dictionary and object both. file name: depth_object.py
- Problem 3: Print least common ancestor of two nodes. file name: lca.py
- Test code: Runs unit test for all the problems. file name: unit_test.py
Prerequisites
Make sure you have installed Python 3
Installation
- Download or Clone the project
git clone https://github.com/kazinayem2011/python_problem_solving.git
- Enter into the project directory.
cd <project_directory>
Run
Now run the problems one by one using the following command.
python3 <file_name>
Unit Testing
To run the test unit, type the following command.
python3 <file_name>