Skip to content

Commit cc96235

Browse files
committed
Added Usage Example section to README (Fixes #13714)
1 parent e2a78d4 commit cc96235

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,20 @@ We are on [Discord](https://the-algorithms.com/discord) and [Gitter](https://git
5050
## 📜 List of Algorithms
5151

5252
See our [directory](DIRECTORY.md) for easier navigation and a better overview of the project.
53+
## 🧩 Usage Example
54+
55+
Here’s how you can clone this repository and run algorithms locally:
56+
57+
1. **Clone the repository**
58+
```bash
59+
git clone https://github.com/TheAlgorithms/Python.git
60+
cd Python
61+
2. **Run an algorithm**
62+
python3 path/to/algorithm.py
63+
3. **Use the interactive Python shell**
64+
python3
65+
>>> from algorithms.category import algorithm_name
66+
>>> algorithm_name(arguments)
67+
4. **Run doctests to verify correctness**
68+
python3 -m doctest -v path/to/algorithm.py
69+

0 commit comments

Comments
 (0)