Skip to content

Commit cefff35

Browse files
author
Shehab Abdel-Salam
committed
Update README, fix imports
1 parent 7eee190 commit cefff35

File tree

3 files changed

+68
-25
lines changed

3 files changed

+68
-25
lines changed

README.md

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
# Udemy - Complete Python Programming Course
1+
# Udemy - The Python Programmer
22

3-
This repository contains exercises and tests for the Udemy course [Complete Python Programming]() designed by Shehab Abdel-Salam.
3+
This repository contains exercises and tests for the Udemy course [The Python Programmer]() designed and maintained by Shehab Abdel-Salam.
44

55
The course is divided into chapters, each containing exercises and tests. The exercises are designed to help students practice Python programming concepts, while the tests are used to verify the correctness of their solutions.
66

77
## 1. Structure
8+
89
The repository has the following structure:
10+
911
```
1012
├── chapters/
1113
│ ├── chapter1/
@@ -39,8 +41,11 @@ The `ninja_challenges` directory contains additional challenges for you to pract
3941
---
4042

4143
## 2. Getting Started
44+
4245
### 2.1 Prerequisites
46+
4347
Before you begin, ensure you have the following installed on your machine:
48+
4449
- Python **3.12** or higher
4550
- `pip` package manager
4651
- `pytest` testing framework
@@ -51,29 +56,46 @@ To check if you have Python installed, run the following command in your termina
5156
python --version
5257
```
5358

59+
If you get a `command not found: python`, you can download and install Python from the official website: [Python Downloads](https://www.python.org/downloads/)
60+
5461
To check if you have `pip` installed, run the following command in your terminal:
5562

5663
```bash
5764
pip --version
5865
```
5966

67+
If you get a `command not found: pip`, you can install `pip` by following the instructions on the official website: [Installing pip](https://pip.pypa.io/en/stable/installation/)
68+
6069
To install **`pytest`**, run the following command in your terminal:
6170

6271
```bash
6372
pip install pytest
6473
```
74+
75+
This will install the latest version of `pytest` on your machine.
76+
77+
> This repository was last tested with `pytest` version **8.3.2**.
78+
79+
> Note that you may need to use `pip3` instead of `pip` depending on your Python installation.
80+
6581
---
82+
6683
### 2.2 Setup
84+
6785
First, make sure to clone the repository to your local machine using the following command:
86+
6887
```bash
6988
git clone https://github.com/shehab-as/Udemy-Complete-Python.git
7089
```
7190

7291
Afterwards, navigate to the repository directory:
92+
7393
```bash
74-
cd Udemy-Complete-Python
94+
cd The-Python-Programmer
7595
```
96+
7697
---
98+
7799
### 2.3 Running the Exercises
78100

79101
1. Navigate to the chapter you are working on:
@@ -91,19 +113,34 @@ cd Udemy-Complete-Python
91113
3. Write your solution in the corresponding exercise file. For example, if you are working on exercise 1 in chapter 1, you should write your solution in the `exercise_ch1_01.py` file.
92114

93115
4. Run the test to verify the correctness of your solution.
116+
94117
> Note: Always use the `-k` flag to run a specific test.
95118
96119
```bash
97120
pytest -k ch01_e01
98121
```
99-
You should see the following output if the test passes:
122+
123+
<details><summary>Click to see the following output if the test fails:</summary>
124+
125+
```bash
126+
tests/test_ch01.py:5: AssertionError
127+
=========================================== short test summary info ===========================================
128+
FAILED tests/test_ch01.py::test_ch01_e01 - AssertionError: assert 'I am ready to learn ______!' == 'I am ready to learn Python!'
129+
=========================================== 1 failed in 0.01s ===========================================
130+
```
131+
132+
</details>
133+
134+
<details><summary>Click to see the following output if the test passes:</summary>
100135

101136
```bash
102137
tests/test_ch_01.py . [100%]
103138

104139
=========================================== 1 passed in 0.01s =============================================
105140
```
106141

142+
</details>
143+
107144
**Optional: You can run all the tests for the chapter you are currently working on:**
108145

109146
```bash
@@ -120,26 +157,31 @@ cd Udemy-Complete-Python
120157
```
121158

122159
---
160+
123161
## 3. [Optional] Running the Ninja Challenges
124162

125163
1. Navigate to the ninja challenges directory:
126164

127165
```bash
128166
cd ninja_challenges/
129167
```
168+
130169
2. Edit the main.py file to write your solution or test your code.
131170

132171
```bash
133172
python main.py
134173
```
174+
135175
3. Run the test to verify the correctness of your solution.
176+
136177
> Note: Always use the `-k` flag to run a specific test.
137178
138179
```bash
139180
pytest -k challenge_01
140181
```
141182

142183
---
184+
143185
## 4. Contributing
144186

145187
If you have any questions or would like to report an issue, feel free to raise an issue on the repository.

ninja_challenges/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Feel free to experiment with the code under `main()` block and run it as many times as you want.
33

44
# You can also import functions from the exercises and use them here.
5+
# For example:
56
# from exercises.challenge_01 import find_peak
67

78

ninja_challenges/tests/test_ninja_challenges.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
from ..exercises.challenge_01 import find_peak
2-
from ..exercises.challenge_02 import blur_image
3-
from ..exercises.challenge_03 import merge_receipts
4-
from ..exercises.challenge_04 import reverse_matrix
5-
from ..exercises.challenge_05 import compute_ip_addresses
6-
from ..exercises.challenge_06 import find_first_missing_positive
7-
from ..exercises.challenge_07 import pascals_triangle
8-
from ..exercises.challenge_08 import tail
9-
from ..exercises.challenge_09 import diagonal_sum
10-
from ..exercises.challenge_10 import find_element_more_than_25_percent
11-
from ..exercises.challenge_11 import tribonacci
12-
from ..exercises.challenge_12 import num_pairs_divisible_by_60
13-
from ..exercises.challenge_13 import is_monotonic
14-
from ..exercises.challenge_14 import add_matrices
15-
from ..exercises.challenge_15 import transpose_matrix
16-
from ..exercises.challenge_16 import is_word_in_matrix
17-
from ..exercises.challenge_17 import compare_versions
18-
from ..exercises.challenge_18 import NestedIterator
19-
from ..exercises.challenge_19 import count_servers
20-
from ..exercises.challenge_20 import integer_to_roman
21-
from ..exercises.challenge_21 import interval_intersection
1+
from exercises.challenge_01 import find_peak
2+
from exercises.challenge_02 import blur_image
3+
from exercises.challenge_03 import merge_receipts
4+
from exercises.challenge_04 import reverse_matrix
5+
from exercises.challenge_05 import compute_ip_addresses
6+
from exercises.challenge_06 import find_first_missing_positive
7+
from exercises.challenge_07 import pascals_triangle
8+
from exercises.challenge_08 import tail
9+
from exercises.challenge_09 import diagonal_sum
10+
from exercises.challenge_10 import find_element_more_than_25_percent
11+
from exercises.challenge_11 import tribonacci
12+
from exercises.challenge_12 import num_pairs_divisible_by_60
13+
from exercises.challenge_13 import is_monotonic
14+
from exercises.challenge_14 import add_matrices
15+
from exercises.challenge_15 import transpose_matrix
16+
from exercises.challenge_16 import is_word_in_matrix
17+
from exercises.challenge_17 import compare_versions
18+
from exercises.challenge_18 import NestedIterator
19+
from exercises.challenge_19 import count_servers
20+
from exercises.challenge_20 import integer_to_roman
21+
from exercises.challenge_21 import interval_intersection
2222

2323

2424
def test_challenge_01():

0 commit comments

Comments
 (0)