Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions L01/T01/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if __name__ == "__main__":
# Write your solution here
pass
7 changes: 7 additions & 0 deletions L01/T01/task-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: theory
custom_name: About
files:
- name: task.md
visible: false
- name: main.py
visible: true
14 changes: 14 additions & 0 deletions L01/T01/task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Welcome

Welcome to the **Complete Python Developer Zero to Mastery** course.

In this course, you will learn Python from the ground up, starting with the fundamentals and gradually moving on to more practical exercises and real working programs. Each section builds on the previous one, helping you develop both understanding and confidence as you progress.

In the next two tasks, you will take your first steps in the development environment. We will explore the IDE interface in more detail and run your first Python program.

#### Prerequisites

You don't need to have any previous experience in Python or programming in general
to complete this course.

**Click the "Next" button to navigate to the next task and good luck!**
9 changes: 9 additions & 0 deletions L01/T02/images/back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added L01/T02/images/edu_course_overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added L01/T02/images/edu_course_overview_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions L01/T02/images/forward.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions L01/T02/images/reset.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions L01/T02/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if __name__ == "__main__":
# Write your solution here
pass
22 changes: 22 additions & 0 deletions L01/T02/task-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
type: theory
custom_name: Navigating Around
files:
- name: task.md
visible: false
- name: main.py
visible: true
- name: images/edu_course_overview.png
visible: false
is_binary: true
- name: images/edu_course_overview_dark.png
visible: false
is_binary: true
- name: images/forward.svg
visible: false
is_binary: true
- name: images/back.svg
visible: false
is_binary: true
- name: images/reset.svg
visible: false
is_binary: true
55 changes: 55 additions & 0 deletions L01/T02/task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## JetBrains Academy plugin overview

This lesson will help you take your first steps with the [JetBrains Academy plugin](https://www.jetbrains.com/help/education/educational-products.html) and use it to learn Python.

With the JetBrains Academy plugin, you can learn programming languages and tools by completing coding tasks and get instant feedback right inside the IDE.

If you're already familiar with the interface, you can skip this lesson.

### Working with courses
When you open a course, you will see the main tool windows used for navigation: <b>Course View</b>, <b>Editor</b>, and <b>Task Description</b>.

<style>
img {
display: block;
margin-left: auto;
margin-right: auto;
}
</style>
<img src="images/edu_course_overview.png" class="center" width=800>

In <b>Course View</b>, you can switch between lessons and tasks. In the <b>Editor</b>, you write code and complete the task. In <b>Task Description</b>, you can read the theory and the task instructions.

### Task Description

The **Task Description** window gives you all the information you need to complete a task:

- For theoretical tasks, the description provides learning and reading materials.
- For programming assignments, it states the problem to be solved.

Use Task Description icons for the following actions:

| Icon | Description |
|------------------------------------|-------------------------------|
|**Check** | <font size="-1">Check the correctness of your answer (for a quiz) or your code solution (for a programming task)</font>|
| **Run** | <font size="-1">Run your code (for a theoretical task)</font>|
|![](images/back.svg) | <font size="-1">Go to the previous task</font> |
|![](images/forward.svg) &nbsp;<font size="-1">or</font> **Next** | <font size="-1">Go to the next task</font>|
|![](images/reset.svg) | <font size="-1">Discard all the changes you’ve made in the task, and start over</font>|
|<a>Peek Solution...</a> | <font size="-1">Reveal the correct answer and show the <b>diff</b></font>|

<style>
img {
display: inline !important;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
}
table td:nth-child(1) {
text-align: center;
}
</style>
3 changes: 3 additions & 0 deletions L01/T03/OurFirstPythonProgram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name = input("what is your name?\n")
print("Hello " + name)

Binary file added L01/T03/images/hello_username.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions L01/T03/images/run.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions L01/T03/images/run_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions L01/T03/task-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
type: theory
custom_name: Your First Python Program
files:
- name: task.md
visible: false
- name: OurFirstPythonProgram.py
visible: true
- name: images/run.svg
visible: false
is_binary: true
- name: images/run_dark.svg
visible: false
is_binary: true
- name: images/hello_username.gif
visible: false
is_binary: true
25 changes: 25 additions & 0 deletions L01/T03/task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
### Understanding the Code

```python
name = input("what is your name?\n") # Gets input from you
print("Hello " + name) # Prints the greeting
```

- `input()` - Asks you to type something
- The Run tool window (at bottom) is where you type and see output
- `print()` - Shows messages on screen

**Try It!**

1. Click the **Run** button (![](images/run.svg)) at the top right
2. Type your name when asked
3. Press Enter
4. See your personalized greeting!

<img src="images/hello_username.gif" width="800">

<style>
img {
display: inline !important;
}
</style>
Binary file added L01/T04/images/placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added L01/T04/images/placeholder_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions L01/T04/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if __name__ == "__main__":
# Write your solution here
pass
13 changes: 13 additions & 0 deletions L01/T04/task-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type: theory
custom_name: Before You Continue
files:
- name: task.md
visible: false
- name: main.py
visible: true
- name: images/placeholder.png
visible: false
is_binary: true
- name: images/placeholder_dark.png
visible: false
is_binary: true
15 changes: 15 additions & 0 deletions L01/T04/task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Entering Multiple Answers

In future tasks, you may see several input fields for your answers. The highlighted box in the image below shows where you need to enter them.

<img src="images/placeholder.png" class="center" width=800>

In such cases, the test checks all fields together. If you enter some correct answers but leave the others empty, the test will not pass. **Make sure to fill in all answer fields before running the test.**

### Comments
In Python, comments start with the hash character (`#`) followed by a single space and extend to the end of the line. They are shown in gray in the editor and **do not affect how the program runs.**

```python
attempt += 1 # Count the number of login attempts
```
You can read more about proper commenting in <a href="https://www.python.org/dev/peps/pep-0008/#comments">PEP 8 – Style Guide for Python Code</a>.
6 changes: 6 additions & 0 deletions L01/lesson-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
custom_name: Introduction
content:
- T01
- T02
- T03
- T04
14 changes: 14 additions & 0 deletions L02/T01/ExerciseOperatorPrecedence.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Operator Precedence Exercise
# Predict the output of each expression before you run the code
# Replace each placeholder value with your prediction (as a number)

# What will each of these print?
answer_1 = 45.0

answer_2 = 45.0

answer_3 = 45.0

answer_4 = 25.0

answer_5 = 25
25 changes: 25 additions & 0 deletions L02/T01/task-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
type: edu
custom_name: Operators And Precedence
files:
- name: task.md
visible: false
- name: ExerciseOperatorPrecedence.py
visible: true
placeholders:
- offset: 208
length: 4
placeholder_text: "# calculate (5 + 4) * 10 / 2"
- offset: 225
length: 4
placeholder_text: "# calculate ((5 + 4) * 10) / 2"
- offset: 242
length: 4
placeholder_text: "# calculate (5 + 4) * (10 / 2)"
- offset: 259
length: 4
placeholder_text: "# calculate 5 + (4 * 10) / 2"
- offset: 276
length: 2
placeholder_text: "# calculate 5 + 4 * 10 // 2"
- name: tests/test_task.py
visible: false
22 changes: 22 additions & 0 deletions L02/T01/task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Operator Precedence Exercise

## Task
Calculate the results for the five expressions below and fill in the answers in `ExerciseOperatorPrecedence.py`.
Now calculate these 5 expressions and enter your answers.

## Operator Precedence
Python evaluates operators in this order (highest to lowest):
1. `**` (exponentiation)
2. `*`, `/`, `//`, `%` (multiplication, division, floor division, modulo)
3. `+`, `-` (addition, subtraction)
4. Parentheses `()` override the default order

## Your Task
Now calculate these 5 expressions and enter your answers.
```python
answer_1 = ... # calculate (5 + 4) * 10 / 2
answer_2 = ... # calculate ((5 + 4) * 10) / 2
answer_3 = ... # calculate (5 + 4) * (10 / 2)
answer_4 = ... # calculate 5 + (4 * 10) / 2
answer_5 = ... # calculate 5 + 4 * 10 // 2
```
94 changes: 94 additions & 0 deletions L02/T01/tests/test_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import importlib
import importlib.util
from io import StringIO
import os
import sys
import unittest
from unittest.mock import patch

TASK_NAME = 'operator_precedence'
TASK_FILE = os.path.join(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
'ExerciseOperatorPrecedence.py'
)


def try_import():
return importlib.import_module(TASK_NAME)


class TestCase(unittest.TestCase):
task_name = TASK_NAME

def setUp(self):
try:
with patch('sys.stdout', new=StringIO()) as self.actualOutput:
if self.task_name in sys.modules:
del sys.modules[self.task_name]
spec = importlib.util.spec_from_file_location(TASK_NAME, TASK_FILE)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
sys.modules[TASK_NAME] = module
except NameError:
pass
except SyntaxError as se:
self.fail("Syntax error while loading the solution – {0}. "
"Please fill in all answers with valid numbers (empty placeholders are invalid)."
.format(str(se)))
except Exception as e:
self.fail("There was a problem while loading the solution – {0}. Check the solution for "
"IDE-highlighted errors and warnings.".format(str(e)))

def test_answer_1(self):
expected_value = 45.0

try:
actual_value = try_import().answer_1
except AttributeError:
self.fail(msg="The variable answer_1 seems to be undefined. Do not remove it from the task code.")

self.assertEqual(expected_value, actual_value, msg="The answer_1 value seems to be a bit off.")

def test_answer_2(self):
expected_value = 45.0

try:
actual_value = try_import().answer_2
except AttributeError:
self.fail(msg="The variable answer_2 seems to be undefined. Do not remove it from the task code.")

self.assertEqual(expected_value, actual_value, msg="The answer_2 value seems to be a bit off.")

def test_answer_3(self):
expected_value = 45.0

try:
actual_value = try_import().answer_3
except AttributeError:
self.fail(msg="The variable answer_3 seems to be undefined. Do not remove it from the task code.")

self.assertEqual(expected_value, actual_value, msg="The answer_3 value seems to be a bit off.")

def test_answer_4(self):
expected_value = 25.0

try:
actual_value = try_import().answer_4
except AttributeError:
self.fail(msg="The variable answer_4 seems to be undefined. Do not remove it from the task code.")

self.assertEqual(expected_value, actual_value, msg="The answer_4 value seems to be a bit off.")

def test_answer_5(self):
expected_value = 25

try:
actual_value = try_import().answer_5
except AttributeError:
self.fail(msg="The variable answer_5 seems to be undefined. Do not remove it from the task code.")

self.assertEqual(expected_value, actual_value, msg="The answer_5 value seems to be a bit off.")


if __name__ == '__main__':
unittest.main()
Loading