Skip to content

Commit 768614e

Browse files
authored
Merge pull request #222 from jetbrains-academy/konstantin/data_structures_improvements
Data structures changes
2 parents cfc80c6 + 8f06115 commit 768614e

File tree

10 files changed

+30
-3
lines changed

10 files changed

+30
-3
lines changed

Data structures/Dictionaries/task.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ You can access a value in a dictionary similarly to how you would access a value
2525
but using a key instead of an index. More info about this data structure can be found
2626
<a href="https://docs.python.org/3/tutorial/datastructures.html#dictionaries">here</a>.
2727

28+
For more structured and detailed information, you can also refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6481).
29+
30+
### Task
2831
Add Jared's (`"Jared"`) number `570` to the phone book.
2932
Remove Gerard's number from the phone book.
3033
Print Jane's phone number from the `phone_book`.

Data structures/Dictionary keys() and values()/task.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ followed by a dot.
1414

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

17+
For more structured and detailed information, you can also refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/11096).
18+
19+
### Task
1720
Print all values from the `phone_book` .
1821

1922
<div class='hint'>Use the method <code>values()</code>.</div>

Data structures/Dictionary keys/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

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

5-
<div class="hint">Remember that dictionary keys can only be immutable types? You could replace the list with several individual key:value pairs with
6-
keys of type <code>str</code> or with a tuple.</div>
7-
<div class="hint">Remember that keys need to be unique? You could rename one of the 'Bob' keys.</div>
5+
When fixing, be aware of the following requirements
6+
- 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.
7+
- Since keys need to be unique, rename one of the `Bob` keys to a name of your choice.

Data structures/In keyword/task.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ item. You can apply `in` to lists or dictionaries the same way you did it with s
88

99
Please complete the task in the specified order.
1010

11+
For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/11096).
12+
1113
<div class="hint">Use the <code>in</code> keyword.</div>
1214

1315
<div class="hint">Use the <code>.values()</code> and <code>.keys()</code> attributes.</div>

Data structures/Join method/task.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ aa = bb = cc
3333
Python is a programming language
3434
```
3535

36+
For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6972#join-a-list).
37+
38+
### Task
3639
Assign a value to the `joined` variable such that the `print` statement prints the following:
3740
```text
3841
I like apples and I like bananas and I like peaches and I like grapes

Data structures/List items/task.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ This way you can even change the size of a list or clear it entirely by doing so
77
animals[:] = []
88
```
99

10+
### Task
1011
Make all `animals` elephants by replacing the last two items.
12+
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.
1113

1214
<div class='hint'>Use assignment to a slice as in examples.</div>
15+
16+
<div class='hint'>You can assign a list consisting of several elements.</div>

Data structures/Lists introduction/task.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ squares + [36, 49, 64, 81, 100]
1717

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

20+
For more structured and detailed information, you can also refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/5979).
21+
22+
### Task
2023
Use list slicing to print `[4, 9, 16]`.
2124

2225
<div class='hint'>List slicing syntax looks just like that for strings: <code>lst[index1:index2]</code>.

Data structures/Lists operations/task.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,8 @@ squares
3232

3333
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>.
3434

35+
For more structured and detailed information, you can also refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6031).
36+
37+
### Task
3538
Replace `"dino"` with `"dinosaur"` in the `animals` list.
3639
<div class='hint'>Use list indexing operation and value assignment.</div>

Data structures/Nested Lists/task.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ Output:
3131
```text
3232
1
3333
```
34+
For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/6938).
35+
36+
### Task
3437
In the code editor, use indexing to access and print elements `9` and `10` from of the nested list `my_list`.
3538

3639
<div class="hint">If you're stuck, review the examples in the task description again.</div>

Data structures/Tuples/task.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ values `12345`, `54321`, and `hello!` are packed together in a tuple.
4040

4141
Some other list methods are also
4242
applicable to tuples. You can read more about tuples <a href="https://docs.python.org/3/tutorial/datastructures.html#tuples-and-sequences">here</a>.
43+
44+
For more structured and detailed information, you can also refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/7462).
4345

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

0 commit comments

Comments
 (0)