Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jetbrains-academy/introduction_to_python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: konstantin/functions_improvements
Choose a base ref
...
head repository: jetbrains-academy/introduction_to_python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.

Commits on Dec 18, 2023

  1. Copy the full SHA
    02e0998 View commit details
  2. Add links checker workflow

    kochaika committed Dec 18, 2023
    Copy the full SHA
    d13e29a View commit details
  3. Copy the full SHA
    b2dde8f View commit details

Commits on Dec 19, 2023

  1. Copy the full SHA
    980dd3d View commit details
  2. Copy the full SHA
    a437d65 View commit details
  3. Copy the full SHA
    5ab8f13 View commit details
  4. Copy the full SHA
    25d8724 View commit details
  5. Add changes to Loops lesson

    kochaika committed Dec 19, 2023
    Copy the full SHA
    688ea6b View commit details
  6. Add Task headers

    kochaika committed Dec 19, 2023
    Copy the full SHA
    a87f704 View commit details
  7. Add Task headers

    kochaika committed Dec 19, 2023
    Copy the full SHA
    a8ebea0 View commit details
  8. Add Task headers

    kochaika committed Dec 19, 2023
    Copy the full SHA
    7069beb View commit details
  9. Add Task headers

    kochaika committed Dec 19, 2023
    Copy the full SHA
    1618e5d View commit details
  10. Add Task headers

    kochaika committed Dec 19, 2023
    Copy the full SHA
    1f79917 View commit details
  11. Fix broken offset

    kochaika committed Dec 19, 2023
    Copy the full SHA
    93f0d23 View commit details

Commits on Dec 20, 2023

  1. Copy the full SHA
    53b8c1b View commit details
  2. Copy the full SHA
    4c96336 View commit details
  3. Copy the full SHA
    42fc183 View commit details

Commits on Dec 21, 2023

  1. Add discord link

    kochaika committed Dec 21, 2023
    Copy the full SHA
    1a9d6a0 View commit details
  2. Merge pull request #218 from jetbrains-academy/konstantin/introductio…

    …n_improvements
    
    Introduction changes
    Geravant authored Dec 21, 2023
    Copy the full SHA
    beec3f0 View commit details

Commits on Dec 26, 2023

  1. Copy the full SHA
    9cb4eba View commit details
  2. Update images

    kochaika committed Dec 26, 2023
    Copy the full SHA
    1bd824b View commit details

Commits on Jan 15, 2024

  1. Language changes

    kochaika committed Jan 15, 2024
    Copy the full SHA
    e5a751f View commit details
  2. Language changes

    kochaika committed Jan 15, 2024
    Copy the full SHA
    4281951 View commit details
  3. Language changes

    kochaika committed Jan 15, 2024
    Copy the full SHA
    ed876e4 View commit details
  4. Language changes

    kochaika committed Jan 15, 2024
    Copy the full SHA
    8f06115 View commit details
  5. Language changes

    kochaika committed Jan 15, 2024
    Copy the full SHA
    3ee2bfa View commit details

Commits on Jan 22, 2024

  1. Merge pull request #219 from jetbrains-academy/konstantin/variables_i…

    …mprovements
    
    Variables changes
    kochaika authored Jan 22, 2024
    Copy the full SHA
    0aa200e View commit details
  2. Merge pull request #221 from jetbrains-academy/konstantin/strings_imp…

    …rovements
    
    Strings changes
    kochaika authored Jan 22, 2024
    Copy the full SHA
    a8cebda View commit details

Commits on Jan 23, 2024

  1. Merge pull request #228 from jetbrains-academy/konstantin/file_io_imp…

    …rovements
    
    File IO lesson, readme and whats next section changes
    kochaika authored Jan 23, 2024
    Copy the full SHA
    7524f3d View commit details
  2. Merge pull request #227 from jetbrains-academy/konstantin/modules_imp…

    …rovements
    
    Modules and packages changes
    kochaika authored Jan 23, 2024
    Copy the full SHA
    8ebeb3b View commit details
  3. Merge pull request #226 from jetbrains-academy/konstantin/classes_imp…

    …rovements
    
    Classes and objects changes
    kochaika authored Jan 23, 2024
    Copy the full SHA
    5e39f89 View commit details
  4. Merge pull request #225 from jetbrains-academy/konstantin/functions_i…

    …mprovements
    
    Functions changes
    kochaika authored Jan 23, 2024
    Copy the full SHA
    c1daeb0 View commit details
  5. Merge pull request #224 from jetbrains-academy/konstantin/loops_impro…

    …vements
    
    Loops changes
    kochaika authored Jan 23, 2024
    Copy the full SHA
    4fbb838 View commit details
  6. Merge pull request #223 from jetbrains-academy/konstantin/condition_i…

    …mprovements
    
    Condition expressions changes
    kochaika authored Jan 23, 2024
    Copy the full SHA
    cfc80c6 View commit details
  7. Merge pull request #222 from jetbrains-academy/konstantin/data_struct…

    …ures_improvements
    
    Data structures changes
    kochaika authored Jan 23, 2024
    Copy the full SHA
    768614e View commit details
  8. Merge pull request #220 from jetbrains-academy/konstantin/links_check…

    …er_action
    
    Add links checker action
    kochaika authored Jan 23, 2024
    Copy the full SHA
    2a8e2c3 View commit details
  9. Copy the full SHA
    c1f77d6 View commit details

Commits on Jan 24, 2024

  1. Merge pull request #229 from jetbrains-academy/konstantin/introductio…

    …n_improvements
    
    Add new style icon in task description
    kochaika authored Jan 24, 2024
    Copy the full SHA
    0b7585f View commit details
  2. Copy the full SHA
    8a729c0 View commit details
  3. Merge pull request #231 from jetbrains-academy/konstantin/marketplace…

    …_updates
    
    Updates after publishing to marketplace
    kochaika authored Jan 24, 2024
    Copy the full SHA
    8e03d82 View commit details

Commits on Feb 24, 2024

  1. Copy the full SHA
    4326e5f View commit details

Commits on May 10, 2024

  1. Improvements of Modules lesson according to feedback

    kochaika committed May 10, 2024
    Copy the full SHA
    da1aa63 View commit details

Commits on Jun 13, 2024

  1. Merge pull request #232 from zoyakostyreva/hyperskill_links_with_utm

    Hyperskill links. UTM tags added
    Geravant authored Jun 13, 2024
    Copy the full SHA
    e898269 View commit details

Commits on Jul 10, 2024

  1. fix: fixed wrong reference to object 'my_object'

    Fixed wrong reference to object 'my_object' in task.md
    Gabriele-Ricciardi committed Jul 10, 2024
    Copy the full SHA
    95961ee View commit details

Commits on Jul 30, 2024

  1. Merge pull request #234 from Gabriele-Ricciardi/fix_task_description_…

    …classes_and_objects_definition
    
    fix: fixed wrong reference to object 'my_object'
    kochaika authored Jul 30, 2024
    Copy the full SHA
    49cc31c View commit details
  2. Copy the full SHA
    acca97b View commit details
  3. Add lesson-info changes

    kochaika committed Jul 30, 2024
    Copy the full SHA
    f1b3606 View commit details
  4. Copy the full SHA
    6d5fef5 View commit details
  5. Changes after proofreading

    kochaika committed Jul 30, 2024
    Copy the full SHA
    48c9fc4 View commit details
  6. Changes after proofreading pt2

    kochaika committed Jul 30, 2024
    Copy the full SHA
    d6b1bad View commit details
Showing with 676 additions and 352 deletions.
  1. +23 −0 .github/workflows/links_checker.yml
  2. +4 −1 .gitignore
  3. +1 −1 Classes and objects/Call a method from another method/task-remote-info.yaml
  4. +3 −1 Classes and objects/Call a method from another method/task.md
  5. +3 −1 Classes and objects/Class and Instance Variables 2/task.md
  6. +3 −0 Classes and objects/Class and Instance Variables/task.md
  7. +4 −1 Classes and objects/Definition/task.md
  8. +2 −0 Classes and objects/Special __init__ method/task.md
  9. +3 −0 Classes and objects/The self parameter/task.md
  10. +2 −0 Classes and objects/Update variable/task.md
  11. +3 −1 Classes and objects/Variable access/task.md
  12. +1 −1 Classes and objects/__str__ vs __repr__/str_and_repr.py
  13. +14 −14 Classes and objects/__str__ vs __repr__/task-info.yaml
  14. +3 −0 Classes and objects/__str__ vs __repr__/task.md
  15. +3 −0 Condition expressions/Boolean operators order/task.md
  16. +3 −0 Condition expressions/Boolean operators/task.md
  17. +3 −0 Condition expressions/Else and elif parts in if statement/task.md
  18. +3 −0 Condition expressions/If statement/task.md
  19. +8 −3 Condition expressions/Single-line if-else statement/task.md
  20. +3 −0 Data structures/Dictionaries/task.md
  21. +3 −0 Data structures/Dictionary keys() and values()/task.md
  22. +3 −3 Data structures/Dictionary keys/task.md
  23. +2 −0 Data structures/In keyword/task.md
  24. +3 −0 Data structures/Join method/task.md
  25. +4 −0 Data structures/List items/task.md
  26. +3 −0 Data structures/Lists introduction/task.md
  27. +3 −0 Data structures/Lists operations/task.md
  28. +3 −0 Data structures/Nested Lists/task.md
  29. +3 −0 Data structures/Tuples/task.md
  30. +1 −1 File input output/Open file/input1.txt
  31. +2 −2 File input output/Open file/open_file.py
  32. +21 −18 File input output/Open file/task-info.yaml
  33. +6 −2 File input output/Open file/task.md
  34. +6 −1 File input output/Open file/tests/test_task.py
  35. +2 −0 File input output/Read all lines/task.md
  36. +2 −1 File input output/Read file/task.md
  37. +16 −2 File input output/What next/task.md
  38. +3 −4 File input output/Write to file/task-info.yaml
  39. +4 −18 File input output/Write to file/task.md
  40. +1 −1 Functions/Args and kwargs/task.md
  41. +1 −1 Functions/Default parameters/task.md
  42. +1 −1 Functions/Definition/task.md
  43. +1 −1 Functions/Docstrings/task.md
  44. +1 −1 Functions/Parameters and call arguments/task.md
  45. +1 −1 Functions/Recursion/task.md
  46. +1 −1 Functions/Return value/task.md
  47. +2 −0 Introduction/About/task.md
  48. +2 −0 Introduction/Comments/comments.py
  49. +9 −9 Introduction/Comments/task-info.yaml
  50. +2 −0 Introduction/Comments/task.md
  51. +3 −0 Introduction/Getting to know you/main.py
  52. +4 −0 Introduction/Getting to know you/task-info.yaml
  53. +1 −0 Introduction/Getting to know you/task-remote-info.yaml
  54. +3 −0 Introduction/Getting to know you/task.md
  55. BIN Introduction/Task Description/images/edu_task_description_window_settings.png
  56. BIN Introduction/Task Description/images/edu_task_description_window_settings_dark.png
  57. +6 −0 Introduction/Task Description/images/moreVertical.svg
  58. +6 −0 Introduction/Task Description/images/moreVertical_dark.svg
  59. +26 −22 Introduction/Task Description/task-info.yaml
  60. +2 −2 Introduction/Task Description/task.md
  61. +8 −7 Introduction/lesson-info.yaml
  62. +2 −0 Loops/Break keyword/task.md
  63. +3 −0 Loops/Continue keyword/task.md
  64. +1 −2 Loops/Else with loops 2/task.md
  65. +3 −0 Loops/Else with loops/task.md
  66. +3 −0 Loops/For loop/task.md
  67. +3 −0 Loops/List Comprehension/task.md
  68. +1 −0 Loops/Loop over a string/task.md
  69. +2 −0 Loops/Nested List Comprehension/task.md
  70. +2 −0 Loops/Nested for Loop/task.md
  71. +3 −0 Loops/While loop/task.md
  72. +5 −2 Modules and packages/Built-in modules/task.md
  73. +1 −1 Modules and packages/Executing modules as scripts/some_module.py
  74. +21 −22 Modules and packages/Executing modules as scripts/task-info.yaml
  75. +2 −0 Modules and packages/Executing modules as scripts/task.md
  76. +1 −1 Modules and packages/Executing modules as scripts/task.py
  77. +4 −4 Modules and packages/From import/task-info.yaml
  78. +3 −0 Modules and packages/From import/task.md
  79. +0 −23 Modules and packages/Import module/task-info.yaml
  80. +3 −0 Modules and packages/Import_module/imports.py
  81. 0 Modules and packages/{Import module/my_module.py → Import_module/my_funcs.py}
  82. +16 −0 Modules and packages/Import_module/task-info.yaml
  83. 0 Modules and packages/{Import module → Import_module}/task-remote-info.yaml
  84. +5 −8 Modules and packages/{Import module → Import_module}/task.md
  85. 0 Modules and packages/{Import module → Import_module}/tests/__init__.py
  86. +20 −0 Modules and packages/Import_module/tests/test_task.py
  87. 0 Modules and packages/Import_module_part_two/__init__.py
  88. 0 Modules and packages/{Import module → Import_module_part_two}/calculator.py
  89. +0 −4 Modules and packages/{Import module → Import_module_part_two}/imports.py
  90. +24 −0 Modules and packages/Import_module_part_two/task-info.yaml
  91. +1 −0 Modules and packages/Import_module_part_two/task-remote-info.yaml
  92. +15 −0 Modules and packages/Import_module_part_two/task.md
  93. 0 Modules and packages/Import_module_part_two/tests/__init__.py
  94. +1 −3 Modules and packages/{Import module → Import_module_part_two}/tests/test_task.py
  95. +28 −28 Modules and packages/Packages/task-info.yaml
  96. +5 −0 Modules and packages/Packages/task.md
  97. +6 −5 Modules and packages/lesson-info.yaml
  98. +7 −5 README.md
  99. +4 −1 Strings/Basic string methods/task.md
  100. +5 −3 Strings/Character escaping/character_escaping.py
  101. +11 −11 Strings/Character escaping/task-info.yaml
  102. +4 −2 Strings/Character escaping/task.md
  103. +1 −1 Strings/Character escaping/tests/test_task.py
  104. +3 −0 Strings/F-strings/task.md
  105. +1 −0 Strings/In operator/task.md
  106. +4 −1 Strings/String formatting/task.md
  107. +4 −1 Strings/String indexing/task.md
  108. +2 −2 Strings/String length/task-info.yaml
  109. +18 −2 Strings/String length/task.md
  110. +5 −0 Strings/String length/tests/test_task.py
  111. +4 −1 Strings/String negative indexing/task.md
  112. +3 −0 Strings/String slicing/task.md
  113. +5 −5 Variables/Arithmetic operators/arithmetic_operators.py
  114. +27 −27 Variables/Arithmetic operators/task-info.yaml
  115. +21 −5 Variables/Arithmetic operators/task.md
  116. +1 −0 Variables/Assignments/task.md
  117. +2 −0 Variables/Boolean operators/task.md
  118. +3 −0 Variables/Comparison operators/task.md
  119. +4 −1 Variables/Type conversion/task.md
  120. +4 −4 Variables/Undefined variable/task.md
  121. +14 −14 Variables/Variable definition/task-info.yaml
  122. +8 −4 Variables/Variable definition/task.md
  123. +7 −16 Variables/Variable definition/tests/test_task.py
  124. +7 −7 Variables/Variable definition/variable_definition.py
  125. +2 −0 Variables/Variable types/task.md
  126. +35 −0 contributing.md
  127. +12 −12 course-info.yaml
  128. +1 −1 course-remote-info.yaml
23 changes: 23 additions & 0 deletions .github/workflows/links_checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: LinksChecker

on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
links-checker-job:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Call the action jetbrains-academy/links-checker-action
uses: jetbrains-academy/links-checker-action@main
with:
dir: ./
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -135,4 +135,7 @@ dmypy.json
!.idea/codeStyles/*
!.idea/vcs.xml
.idea/
*.iml
*.iml

# Course files that shouldn't be committed
/.coursecreator/
Original file line number Diff line number Diff line change
@@ -1 +1 @@
id: 615106464
id: 615106464
Original file line number Diff line number Diff line change
@@ -2,4 +2,6 @@

As we discussed before, methods may call other methods by using method attributes of the `self` argument.
Use this knowledge to complete the `exponentiate` method of the `Calculator` class. It should
call the `multiply` method to calculate the result.
call the `multiply` method to calculate the result.

For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6931?utm_source=jba&utm_medium=jba_courses_links).
4 changes: 3 additions & 1 deletion Classes and objects/Class and Instance Variables 2/task.md
Original file line number Diff line number Diff line change
@@ -7,4 +7,6 @@ all added city names.

Implement the method `add_city` that will append a city name to the `all_cities` list. Do not forget to delete the `pass` statement!

In the `__init__` method, call the `add_city` method to add the city name to the list upon object initialization.
In the `__init__` method, call the `add_city` method to add the city name to the list upon object initialization.

For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6981?utm_source=jba&utm_medium=jba_courses_links).
3 changes: 3 additions & 0 deletions Classes and objects/Class and Instance Variables/task.md
Original file line number Diff line number Diff line change
@@ -36,6 +36,9 @@ one object, it will be changed for all objects of the class (check out the examp
editor – see what `print(barsik.favorite_food)` will print). If you intend using a list to keep track
of features unique to each instance, you need to make it an instance attribute.

For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6677?utm_source=jba&utm_medium=jba_courses_links).

### Task
In the code editor, complete the implementation of the `Animals` class so that the `print` statement
below prints a line like this: `"This is Doggy the dog, one of my pets."` for each of the pets.

5 changes: 4 additions & 1 deletion Classes and objects/Definition/task.md
Original file line number Diff line number Diff line change
@@ -43,7 +43,10 @@ variable `x`.
You can find out more about class definition syntax by reading <a href="https://docs.python.org/3/tutorial/classes.html#class-definition-syntax">this section</a>
of Python Documentation.

Assign a value to `variable` inside `MyClass` and create an object `my_class` of the class `MyClass()`.
For more structured and detailed information, you can also refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6661?utm_source=jba&utm_medium=jba_courses_links).

### Task
Assign a value to `variable` inside `MyClass` and create an object `my_object` of the class `MyClass()`.
Run the code and see what happens!

<div class='hint'>Assign any value to <code>variable</code>.</div>
2 changes: 2 additions & 0 deletions Classes and objects/Special __init__ method/task.md
Original file line number Diff line number Diff line change
@@ -36,7 +36,9 @@ x.num
(3-4.5j)
```

For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6669#def-__init?utm_source=jba&utm_medium=jba_courses_links).

### Task
In the code editor, add parameters to the`__init__()` method of the `Car` class, so we can
create it with a specified color and brand.

3 changes: 3 additions & 0 deletions Classes and objects/The self parameter/task.md
Original file line number Diff line number Diff line change
@@ -22,6 +22,9 @@ class Bag:
self.add(x)
```

For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6669#self?utm_source=jba&utm_medium=jba_courses_links).

### Task
In the code editor, implement the `add` method of the `Calculator` class. It should
add `amount` to the field `current`. In addition, complete the method `get_current`.
Run the code to see how it works.
2 changes: 2 additions & 0 deletions Classes and objects/Update variable/task.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@ In this exercise, create a new `Car` object `car2` and then set `color`
of `car2` to `"red"`. Print the descriptions of `car1` and `car2` by calling the
`description` method.

For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6677#changing-attributes?utm_source=jba&utm_medium=jba_courses_links).

<div class='hint'>Remember how we instantiated objects in the previous task by
"calling" the class.</div>
<div class='hint'>Change the color using value assignment (<code>=</code>) and
4 changes: 3 additions & 1 deletion Classes and objects/Variable access/task.md
Original file line number Diff line number Diff line change
@@ -17,7 +17,9 @@ then `MyClass.year` and `MyClass.say_hello` are valid attribute references retur
integer and a function object, respectively. Class attributes can be
assigned to, so you can change the value of `MyClass.year` by assignment.


For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6661#class-attribute?utm_source=jba&utm_medium=jba_courses_links).

### Task
Check out our example and print the value of `variable1` from `my_object`.
Call the `foo` method of the object `my_object`, print the result.

2 changes: 1 addition & 1 deletion Classes and objects/__str__ vs __repr__/str_and_repr.py
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ def __init__(self, real_part, imag_part):
self.img = imag_part

def __repr__(self):
return f'Complex(10, 20)'
return f'Complex({self.real}, {self.img})'

def __str__(self):
return f'{self.real} + i{self.img}'
28 changes: 14 additions & 14 deletions Classes and objects/__str__ vs __repr__/task-info.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
type: edu
files:
- name: str_and_repr.py
visible: true
placeholders:
- offset: 438
length: 46
placeholder_text: ???
- offset: 524
length: 45
placeholder_text: ???
- name: tests/__init__.py
visible: false
- name: tests/test_task.py
visible: false
feedback_link: https://docs.google.com/forms/d/e/1FAIpQLSfRlDlldKfuq-cHMNFfHMER61P1PRIan7KG6yp1GvaweDI7GA/viewform?usp=pp_url&entry.2103429047=Classes+and+Objects+/+str+vs+repr
- name: str_and_repr.py
visible: true
placeholders:
- offset: 455
length: 46
placeholder_text: ???
- offset: 541
length: 45
placeholder_text: ???
- name: tests/__init__.py
visible: false
- name: tests/test_task.py
visible: false
feedback_link: https://docs.google.com/forms/d/e/1FAIpQLSfRlDlldKfuq-cHMNFfHMER61P1PRIan7KG6yp1GvaweDI7GA/viewform?usp=pp_url&entry.2103429047=Classes+and+Objects+/+str+vs+repr
3 changes: 3 additions & 0 deletions Classes and objects/__str__ vs __repr__/task.md
Original file line number Diff line number Diff line change
@@ -27,6 +27,9 @@ Also, if we think it would be useful to have a string representation for users,
a `__str__` function. Check out another implementation of the class `Complex` in the code editor. Run the code
to see what each of the two `print` statements prints.

For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/7139#str__-vs-__repr?utm_source=jba&utm_medium=jba_courses_links).

### Task
Implement `__str__` and `__repr__` methods for the class `Cat`. `__str__` method should return a string like this:
`"My siamese cat's name is Lucy"`; `__repr__` method should return a string like this:
`"Cat, breed: siamese, name: Lucy"`. Use [f-strings](course://Strings/F-strings).
3 changes: 3 additions & 0 deletions Condition expressions/Boolean operators order/task.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,9 @@
Boolean operators are not evaluated from left to right. There's an order of operations for
boolean operators: `not` is evaluated first, `and` is evaluated next, and `or` is evaluated last.

For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6025?utm_source=jba&utm_medium=jba_courses_links).

### Task
Write an expression that evaluates to `True` if `name` is either `"John"` or `"Jane"` who are `16` or older, but younger than `25`.

<div class='hint'>Combine the <code>and</code> and <code>or</code> keywords.</div>
3 changes: 3 additions & 0 deletions Condition expressions/Boolean operators/task.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@ operator `and` returns `True` when the expressions on both sides of `and` are `T
The boolean operator `or` returns `True` when at least one expression on either side
of `or` is `True`. The boolean operator `not` inverts the boolean expression it precedes.

For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6025?utm_source=jba&utm_medium=jba_courses_links).

### Task
Write an expression that evaluates to `True` if `name` is equal to `"John"` and
he is `16` or older.

Original file line number Diff line number Diff line change
@@ -41,6 +41,9 @@ a += 1 if a > b else a -= 1
```
</details>

For more structured and detailed information, you can refer to [this](https://hyperskill.org/learn/step/5932?utm_source=jba&utm_medium=jba_courses_links) and [this](https://hyperskill.org/learn/step/5926?utm_source=jba&utm_medium=jba_courses_links) Hyperskill knowledge base pages.

### Task
Print `True` if `name` is equal to `"John"` and `False` otherwise.

<div class='hint'>Use the <code>if</code> keyword and the <code>==</code> operator.</div>
3 changes: 3 additions & 0 deletions Condition expressions/If statement/task.md
Original file line number Diff line number Diff line change
@@ -26,6 +26,9 @@ If you have only one statement to execute, you can put it on the same line as th
if a > b: print("a is greater than b")
```

For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/5953?utm_source=jba&utm_medium=jba_courses_links).

### Task
Print `"Not an empty list!"` if the `tasks` list is not empty.
After the list is cleared, check again (you might need a different condition!) and print `'Now empty!'` if it is.

11 changes: 8 additions & 3 deletions Condition expressions/Single-line if-else statement/task.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
## Single-line if-else statement
As you saw in the previous tasks, a simple `if-else` statement can in fact be written as a single line.

As you saw in the previous tasks, a simple `if-else` statement can in fact be written as a single line. Rewrite the statement in the code editor so that it
fits in one line but the results of its execution remain exactly the same.
### Task
Rewrite the statement in the code editor so that it
fits in one line but the results of its execution remain exactly the same:
- If `my_random_number` is greater than 50, the program should print the value of `my_random_number`.
- Otherwise, it should print the message `"Too small!"`.

For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/5932#simple-if-else?utm_source=jba&utm_medium=jba_courses_links).
3 changes: 3 additions & 0 deletions Data structures/Dictionaries/task.md
Original file line number Diff line number Diff line change
@@ -25,6 +25,9 @@ You can access a value in a dictionary similarly to how you would access a value
but using a key instead of an index. More info about this data structure can be found
<a href="https://docs.python.org/3/tutorial/datastructures.html#dictionaries">here</a>.

For more structured and detailed information, you can also refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6481?utm_source=jba&utm_medium=jba_courses_links).

### Task
Add Jared's (`"Jared"`) number `570` to the phone book.
Remove Gerard's number from the phone book.
Print Jane's phone number from the `phone_book`.
3 changes: 3 additions & 0 deletions Data structures/Dictionary keys() and values()/task.md
Original file line number Diff line number Diff line change
@@ -14,6 +14,9 @@ followed by a dot.

Read more about the operations that dictionaries support <a href="https://docs.python.org/3/library/stdtypes.html#typesmapping">here</a>.

For more structured and detailed information, you can also refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/11096?utm_source=jba&utm_medium=jba_courses_links).

### Task
Print all values from the `phone_book` .

<div class='hint'>Use the method <code>values()</code>.</div>
6 changes: 3 additions & 3 deletions Data structures/Dictionary keys/task.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,6 @@

Try to figure out what's wrong with this dictionary and fix it.

<div class="hint">Remember that dictionary keys can only be immutable types? You could replace the list with several individual key:value pairs with
keys of type <code>str</code> or with a tuple.</div>
<div class="hint">Remember that keys need to be unique? You could rename one of the 'Bob' keys.</div>
When fixing, be aware of the following requirements
- Since dictionary keys can only be of immutable types, replace the list with several individual `key:value` pairs with keys of type `str` or with a tuple.
- Since keys need to be unique, rename one of the `Bob` keys to a name of your choice.
2 changes: 2 additions & 0 deletions Data structures/In keyword/task.md
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@ item. You can apply `in` to lists or dictionaries the same way you did it with s

Please complete the task in the specified order.

For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/11096?utm_source=jba&utm_medium=jba_courses_links).

<div class="hint">Use the <code>in</code> keyword.</div>

<div class="hint">Use the <code>.values()</code> and <code>.keys()</code> attributes.</div>
3 changes: 3 additions & 0 deletions Data structures/Join method/task.md
Original file line number Diff line number Diff line change
@@ -33,6 +33,9 @@ aa = bb = cc
Python is a programming language
```

For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6972#join-a-list?utm_source=jba&utm_medium=jba_courses_links).

### Task
Assign a value to the `joined` variable such that the `print` statement prints the following:
```text
I like apples and I like bananas and I like peaches and I like grapes
4 changes: 4 additions & 0 deletions Data structures/List items/task.md
Original file line number Diff line number Diff line change
@@ -7,6 +7,10 @@ This way you can even change the size of a list or clear it entirely by doing so
animals[:] = []
```

### Task
Make all `animals` elephants by replacing the last two items.
We suggest that you first run the program in the IDE without making any changes. This will allow you to see what the `animals` list looks like after all the operations have been performed.

<div class='hint'>Use assignment to a slice as in examples.</div>

<div class='hint'>You can assign a list consisting of several elements.</div>
3 changes: 3 additions & 0 deletions Data structures/Lists introduction/task.md
Original file line number Diff line number Diff line change
@@ -17,6 +17,9 @@ squares + [36, 49, 64, 81, 100]

You can explore lists in more detail by reading <a href="https://docs.python.org/3.9/tutorial/introduction.html#lists">this page</a>.

For more structured and detailed information, you can also refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/5979?utm_source=jba&utm_medium=jba_courses_links).

### Task
Use list slicing to print `[4, 9, 16]`.

<div class='hint'>List slicing syntax looks just like that for strings: <code>lst[index1:index2]</code>.
3 changes: 3 additions & 0 deletions Data structures/Lists operations/task.md
Original file line number Diff line number Diff line change
@@ -32,5 +32,8 @@ squares

Find out about many other useful list methods on <a href="https://docs.python.org/3/tutorial/datastructures.html#more-on-lists">this page</a>.

For more structured and detailed information, you can also refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6031?utm_source=jba&utm_medium=jba_courses_links).

### Task
Replace `"dino"` with `"dinosaur"` in the `animals` list.
<div class='hint'>Use list indexing operation and value assignment.</div>
3 changes: 3 additions & 0 deletions Data structures/Nested Lists/task.md
Original file line number Diff line number Diff line change
@@ -31,6 +31,9 @@ Output:
```text
1
```
For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6938?utm_source=jba&utm_medium=jba_courses_links).

### Task
In the code editor, use indexing to access and print elements `9` and `10` from of the nested list `my_list`.

<div class="hint">If you're stuck, review the examples in the task description again.</div>
3 changes: 3 additions & 0 deletions Data structures/Tuples/task.md
Original file line number Diff line number Diff line change
@@ -40,7 +40,10 @@ values `12345`, `54321`, and `hello!` are packed together in a tuple.

Some other list methods are also
applicable to tuples. You can read more about tuples <a href="https://docs.python.org/3/tutorial/datastructures.html#tuples-and-sequences">here</a>.

For more structured and detailed information, you can also refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/7462?utm_source=jba&utm_medium=jba_courses_links).

### Task
Print the length of the tuple `alphabet`. Then create a tuple with a single element `'fun_tuple'`.
You can run the code to see what it prints.

2 changes: 1 addition & 1 deletion File input output/Open file/input1.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This is the entire file.
outfile.txt
4 changes: 2 additions & 2 deletions File input output/Open file/open_file.py
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@


with open('input1.txt', 'r') as file:
print(file.read())
outfile_name = file.readline()


outfile = open('outfile.txt', 'w') # Opening the file in write mode (using `w` argument)
outfile = open(outfile_name, 'w') # Opening the file in write mode (using the `w` argument)
outfile.write('Hello World') # Writing to the file, the write() method is explained later.
outfile.close()
39 changes: 21 additions & 18 deletions File input output/Open file/task-info.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
type: edu
files:
- name: open_file.py
visible: true
placeholders:
- offset: 152
length: 37
placeholder_text: '# Open the file input1.txt in read mode using the with statement'
- offset: 397
length: 15
placeholder_text: '# Close the output file!'
- name: input.txt
visible: true
- name: input1.txt
visible: true
- name: tests/__init__.py
visible: false
- name: tests/test_task.py
visible: false
feedback_link: https://docs.google.com/forms/d/e/1FAIpQLSfRlDlldKfuq-cHMNFfHMER61P1PRIan7KG6yp1GvaweDI7GA/viewform?usp=pp_url&entry.2103429047=File+Input+Output+/+Open+file
- name: open_file.py
visible: true
placeholders:
- offset: 152
length: 37
placeholder_text: '# Open the file input1.txt in read mode using the with statement'
- offset: 242
length: 12
placeholder_text: ???
- offset: 412
length: 15
placeholder_text: '# Close the output file!'
- name: input.txt
visible: true
- name: input1.txt
visible: true
- name: tests/__init__.py
visible: false
- name: tests/test_task.py
visible: false
feedback_link: https://docs.google.com/forms/d/e/1FAIpQLSfRlDlldKfuq-cHMNFfHMER61P1PRIan7KG6yp1GvaweDI7GA/viewform?usp=pp_url&entry.2103429047=File+Input+Output+/+Open+file
Loading