Python
-
Theory
- I. Python interpreter
- II. Basics of the language Python
- 1. Types, numbers, operations
- 2. Strings
- 2.1. Strings. General concepts. String declaration. Operations with strings. Examples
- 2.2. Escape-sequences. Unformatted strings. Multiline text blocks
- 2.3. Access by indexes. Slices. Get a fragment of a string. Examples
- 2.4. Built-in functions for working with strings
- 2.5. Class str. Functions for working with strings
- 2.5.1. Functions for working with string that determine the features of a string: isalnum(), isalpha(), isascii(), isdecimal(), isdigit(), isidentifier(), islower(), isnumeric(), isprintable(), isspace(), istitle(), isupper()
- 2.5.2. Functions based on searching and replacing a substring in a string: count(), find(), index(), rfind(), rindex(), replace()
- 2.5.3. Functions defining and processing the beginning and the end of a string: endswith(), startswith(), lstrip(), rstrip(), strip()
- 2.5.4. Formatting styles. String processing functions according to format or encoding rule: encode(), expandtabs(), format()
- 2.5.5. Functions of strings alignment: center(), ljust(), rjust(), zfill()
- 2.5.6. Functions that process case-sensitive characters in a string: capitalize(), casefold(), lower(), swapcase(), title(), upper()
- 2.5.7. Functions for breaking strings into parts and forming new strings using tuples and lists: join(), partition(), rpartition(), rsplit(), split(), splitlines()
- 2.6. String formatting operations. String formatting expressions. Binary operator %
- 3. Lists
- 3.1. Lists. List properties. Examples that demonstrate properties of lists
- 3.2. Operation with lists: concatenation (+), duplication (–), deletion, slice, access by index
- 3.3. Lists processing in loops. Generating lists using lists generators. Iterations through the lists. Presentation and processing matrices using lists. Operation in
- 3.4. Methods for working with lists. Examples
- 3.5. Objects-iterators. Using iterators and generators for lists. Functions range(), next(), iter()
- 4. Dictionaries
- 4.1. Dictionaries. Basic concepts. Specifications. Creating dictionaries. Accessing dictionary values
- 4.2. Build-in functions and dictionary processing operations
- 4.3. Methods of working with dictionaries
- 4.4. Working with dictionaries. Build-in functions list(), zip(). Dictionary bypass. Dictionary generators. Sorting. Combinations of dictionaries with sets
- 5. Tuples
- 6. Files
- 6.1. Files. General concepts. Opening/closing a file. Functions open(), close()
- 6.2. Examples of working with text files
- 6.3. Binary files. Examples of working of binary files
- 6.4. Module struct. Working with binary files. Examples of writing/reading packed binary data
- 6.5. Module pickle. Serialization of objects. Examples of use for writing/reading information from binary files
- 6.6. Examples of solving tasks on modifying text files
- 7. Sets
- 7.1. Basic concepts. Creating a set. Operation in. The set operations to create a new set
- 7.2. Operations and functions for defining supersets and subsets. Comparison of sets
- 7.3. Classes set, frozenset. Functions for working with sets. Purpose. Examples
- 7.4. Limitations on the use of sets. The use of class frozenset. Generators of sets
- 9. Control instructions
- 10. Functions. Scopes of names
- 10.1. Concept of function. General form. Examples of declaring and using functions
- 10.2. Scopes of names. Local and global names. Visibility rules for names. LEGB rule. The global keyword. Overriding names in function
- 10.3. Nested functions. Nested scopes. Name search rules in case of nested functions. Factory functions. Passing value to a nested function
- 10.4. The nonlocal keyword. Features of use. Examples
- 10.5. Arguments in functions
- 10.5.1. Passing arguments to a function. Changing arguments in the body of a function
- 10.5.2. Argument matching modes. Classification. Matching by position. Matching by name. Default arguments
- 10.5.3. Argument matching modes. Variable length arguments. Combining different ways of matching arguments. Examples
- 10.6. Recommendations for the correct structuring of programs using functions. Implicit function call
- 10.7. Passing a function as an argument. Data structures containing a list of functions. Returning a function from another function using the return statement. Example
- 10.8. Recursion in Python. Examples of tasks solving
- 11. Anonymous functions. Lambda expressions
- 11.1. Lambda expressions. Anonymous functions. The lambda keyword. Transition table
- 11.2. Default arguments in lambda-expressions. Lambda-expressions in the body of enclosing function. Nested lambda-expressions
- 11.3. Implementing complex logic in lambda-expressions. Condition check. Using lambda-expressions for sequences. Functions map(), filter(), reduce()
- 12. Classes
- 12.1. Classes in Python. General concepts. The class keyword. Class objects. Instance objects
- 12.2. Class inheritance. Rules for applying inheritance. Examples
- 12.3. Classes and modules. Referring to the classes of other modules
- 12.4. Overloading operators
- 12.4.1. Overloading operators in classes. General information. Operators overloading methods. Examples
- 12.4.2. Accessing elements by index. Methods __getitem__() and __setitem()__
- 12.4.3. Overloading binary arithmetic operators in classes: +, –, *, /, //, %
- 12.4.4. Overloading the shortened assignment operators +=, -=, *=, /=, //=, %=
- 13. List generators. Iterators
- 13.1. List generators. Basic concepts
- 13.2. List generators for matrix operations. Examples
- 13.3. Generator functions. Statement yield. Methods next(), iter(), send()
- 13.4. Generator expressions. Differences between generator expressions and list generators
- 13.5. Using standard functions in combination with generator expressions. Functions sum(), sorted(), map(), all(), any(), min(), max(), filter(), zip(), enumerate()
- 13.6. Generators of sets. Dictionary generators. Sets and generator expressions. Examples
- 13.7. Using nested if and for constructs in list, set and dictionary generators
- 14. Modules
- III. Standard Library
- 1. Module io. Class hierarchy. Class IOBase. Methods for working with files
- 2. Module math
- 3. Module random
- 4. Module struct. Packing/Unpacking data. Basic methods
- 5. Module cmath. Complex numbers
- 5.1. Complex numbers. The cmath module. Creation of a complex numbers. The complex class. Functions and constants of the cmath module
- 5.2. Functions for converting to polar coordinates and vice versa. Power and logarithmic functions
- 5.3. Trigonometric functions. Hyperbolic functions. Classification functions
-
Practice
- 1. Examples of tasks solving
⇑