Short version · Lessons 1-3
Key topics of the three lessons in concentrated form. Then - practice.
What we'll refresh
No new topics - just what you already know, all on one screen. After that - 25 tasks in Jupyter.
Lesson 1
type(x) - check the type of a variableint(), float(), str() - type conversion== != < > <= >=and / or / notLesson 2
range(start, stop, step) - upper bound is excludedbreak - exit the loop, continue - skip iteration-1 - last element[start:stop:step] - list sliceLesson 3 · part 1
| Type | Literal | Mutable | When to use |
|---|---|---|---|
| list | [1, 2, 3] | yes | growing sequence |
| tuple | (1, 2, 3) | no | fixed bundle (x, y) |
| set | {1, 2, 3} | yes | unique · fast in O(1) |
| dict | {"k": 1} | yes | lookup by name O(1) |
dictsettuplelistLesson 3 · part 2
return exits the function[], NOT {})*args - tuple of positional, **kwargs - dict of keywordlambda x: expr - one line, one expressionLEGB ruleAll together
One function, all three lessons: types, loop, dict, list, *args, default, lambda.
If this code makes sense - you're good. If not - on to practice.
Practice
After practice
Lesson 4 - OOP: classes, methods, inheritance. Combining data and behavior.
Telegram: @gokalqurt