You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-4Lines changed: 46 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,13 @@
1
-
# Udemy - Complete Python Programming Course
1
+
# Udemy - The Python Programmer
2
2
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.
4
4
5
5
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.
6
6
7
7
## 1. Structure
8
+
8
9
The repository has the following structure:
10
+
9
11
```
10
12
├── chapters/
11
13
│ ├── chapter1/
@@ -39,8 +41,11 @@ The `ninja_challenges` directory contains additional challenges for you to pract
39
41
---
40
42
41
43
## 2. Getting Started
44
+
42
45
### 2.1 Prerequisites
46
+
43
47
Before you begin, ensure you have the following installed on your machine:
48
+
44
49
- Python **3.12** or higher
45
50
-`pip` package manager
46
51
-`pytest` testing framework
@@ -51,29 +56,46 @@ To check if you have Python installed, run the following command in your termina
51
56
python --version
52
57
```
53
58
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
+
54
61
To check if you have `pip` installed, run the following command in your terminal:
55
62
56
63
```bash
57
64
pip --version
58
65
```
59
66
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
+
60
69
To install **`pytest`**, run the following command in your terminal:
61
70
62
71
```bash
63
72
pip install pytest
64
73
```
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
+
65
81
---
82
+
66
83
### 2.2 Setup
84
+
67
85
First, make sure to clone the repository to your local machine using the following command:
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.
92
114
93
115
4. Run the test to verify the correctness of your solution.
116
+
94
117
> Note: Always use the `-k` flag to run a specific test.
95
118
96
119
```bash
97
120
pytest -k ch01_e01
98
121
```
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>
100
135
101
136
```bash
102
137
tests/test_ch_01.py . [100%]
103
138
104
139
=========================================== 1 passed in 0.01s =============================================
105
140
```
106
141
142
+
</details>
143
+
107
144
**Optional: You can run all the tests for the chapter you are currently working on:**
108
145
109
146
```bash
@@ -120,26 +157,31 @@ cd Udemy-Complete-Python
120
157
```
121
158
122
159
---
160
+
123
161
## 3. [Optional] Running the Ninja Challenges
124
162
125
163
1. Navigate to the ninja challenges directory:
126
164
127
165
```bash
128
166
cd ninja_challenges/
129
167
```
168
+
130
169
2. Edit the main.py file to write your solution or test your code.
131
170
132
171
```bash
133
172
python main.py
134
173
```
174
+
135
175
3. Run the test to verify the correctness of your solution.
176
+
136
177
> Note: Always use the `-k` flag to run a specific test.
137
178
138
179
```bash
139
180
pytest -k challenge_01
140
181
```
141
182
142
183
---
184
+
143
185
## 4. Contributing
144
186
145
187
If you have any questions or would like to report an issue, feel free to raise an issue on the repository.
0 commit comments