The Essential Python Tutorial
A detailed tutorial on the Python programming language. For beginners. Lots of theory and tasks.
Basics
001
Introduction to Python for Beginners
002Checking Python Version
003Python Output to Screen
004Python Philosophy
005Comments in Python
006Variables in Python
007Outputting a variable to the console in Python
008Mathematical Operations with Numbers in Python
009Mathematical Operations with Variables in Python
010Shortcuts in Python
011Precedence of Mathematical Operations in Python
012Equal Precedence in Python
013Grouping Brackets in Python
014The Nuances of Grouping in Python
015Length of a Number in Python
016Floating Point Numbers in Python
017Negative Numbers in Python
018Remainder of division in Python
019Exponentiation in Python
020Exponentiation Precedence in Python
021Strings in Python
022Concatenation of strings in Python
023Multiplying Strings in Python
024String characters in Python
025Escaping String Characters in Python
026String Length in Python
027Multiline Strings in Python
028Boolean Values in Python
029None value in Python
030Strong Typing in Python
031Convert to String in Python
032Converting to Integers in Python
033Strings with numbers in Python
034Getting Characters from a Number in Python
035Converting to Floating Point in Python
036The input function in Python
Lists
037
Lists in Python
038Creating Lists Using Square Brackets in Python
039Creating Lists Using the List Function in Python
040Splitting a String into a List in Python
041Getting a Single Element of a List in Python
042Length of a list in Python
043Last element of a list in Python
044Modifying List Elements in Python
045Adding Elements to the End of a List in Python
046Adding Items by Position to a List in Python
047Combining Lists with the extend Method in Python
048Concatenating Lists in Python
049Appending to a List in Python
050Removing elements from a list using the del operator in Python
051Removing Elements from a List by Their Value in Python
052Getting and Removing an Element from a List in Python
053Remove All Elements From a List in Python
054Finding the index of an element by its value in Python
055Checking if an element is in a list in Python
056Counting Items in a List in Python
057Reverse the order of elements in a list in Python
058Sorting Elements in a Source List in Python
059Sorting Elements in a Copy of a List in Python
060Merge List To String In Python
Corteges
061
Tuples in Python
062Creating a Tuple in Python
063An Alternative Way to Create a Tuple in Python
064Tuple of one element in Python
065Alternative Tuple Syntax in Python
066Individual element of a tuple in Python
067Modifying Elements in Python
068Length of a tuple in Python
069Concatenating Tuples in Python
070Multiplying Tuples in Python
071Presence of element in tuple in Python
072Unpacking Tuples in Python
073Converting to a Tuple in Python
074Converting a Tuple to a List in Python
075Merge Tuple to String in Python
Slices
076
Slices in Python
077Slicing a Range of Positions in Python
078Slice by Position in Python
079Slice to Position in Python
080Slice with Negative Positions in Python
081Sampling step for slicing in Python
082Slice with only sampling step in Python
083The whole slice in Python
084Reversing a Sequence in Python
085Removing Elements Using Slices in Python
Dictionaries
086
Dictionaries in Python
087An Alternative Way to Create a Dictionary in Python
088Dictionary Element Value in Python
089Changing the value of a dictionary item in Python
090Adding an item to a dictionary in Python
091Dictionary Length in Python
092Merging Dictionaries in Python
093Merge Dictionaries with Same Elements in Python
094Removing Elements from Dictionary by Key in Python
095Extracting an Element by Key in Python
096Extracting the Last Element in Python
097Remove All Elements from a Dictionary in Python
098Having an item in a dictionary in Python
099Optionally get an element from a dictionary in Python
100Converting Dictionary Values to List in Python
101Getting All Keys from a Dictionary in Python
102Getting All Values from a Dictionary in Python
103Getting Key-Value Pairs from Dictionary in Python
104Converting to Dictionary in Python
105Practicing the studied material on working with dictionaries in Python
Sets
106
Sets in Python
107Set Element in Python
108Duplicate Elements in a Set in Python
109Length of a set in Python
110Adding an Element to a Set in Python
111Adding Multiple Elements to a Set in Python
112Union of Sets in Python
113Removing an Element from a Set in Python
114Removing an Element from a Set in Python
115Extracting an Element from a Set in Python
116Removing All Elements from a Set in Python
117Having an Element in a Set in Python
118Having a Set in a Sequence in Python
119Comparing Sets in Python
120Common Elements of Multiple Sets in Python
121Different Elements of Multiple Sets in Python
122Set Difference in Python
123Complex Set Operations in Python
124Converting to Set in Python
125Practicing the material studied on working with sets in Python
Terms and Conditions
126
The if-else construct in Python
127Indentation in if-else construct in Python
128Greater Than and Less Than Operators in Python
129Checking for Equality in Python
130Checking for Inequality in Python
131Logical AND in Python
132Logical OR in Python
133Logical NOT in Python
134Precedence of Comparison Operators in Python
135Grouping Conditions in Python
136Double Comparisons in Python
137Checking for presence in Python
138Checking for Special Values in Python
139Shortened if in if-else construct
140The elif construct in Python
141Nested if statements in Python
142Python match-case construct
143Ternary Operator in Python
144Checking the type of an object in Python
145If-else Workshop in Python
Cycles
146
For loop in Python
147Accumulating the result in a for loop in Python
148For Loop and If Condition in Python
149The break statement in Python
150The continue statement in Python
151Getting Elements and Their Indices in Python
152Dictionary keys via for in Python
153Dictionary values via for in Python
154Dictionary key value pair via for in Python
155Dictionary index-element pairs in Python
156Generating Numbers with for in Python
157Generating Numbers with Steps Using For in Python
158Iterating Over Sequences Simultaneously in Python
159The while loop in Python
160While Loop Without Counter in Python
161If condition in while loop in Python
162Working with Flags in Python
163Intercepting Loop Exit in Python
164Python Cycles Workshop
165Entering Data in a Loop in Python
Multidimensionality
166
Multidimensional Lists in Python
167Three-dimensional list in Python
168Iterating Over Multidimensional Lists in Python
169Iterating over a 3D list in Python
170Let's print all dictionary keys to the screen. To do this, we'll run our list through a loop twice:
171Populating Multidimensional Lists in Python
Standard functions
172
Power and Root in Python
173Rounding Functions in Python
174Extreme Numbers in Python
175Random in Python
176Modules in Python
177Mathematical Operations with Numbers in Python
178Dividing Numbers in Python
179Case Sensitivity in Python
180Splitting Strings in Python
181String Formatting in Python
182Searching Strings in Python
183Checking a String in Python
Time
184
Working with Dates in Python
185Printing Current Date in Python
186Getting the Day of the Week in Python
187Difference between two dates in Python
188Detecting Leap Year in Python
189Printing Time in Python
190Date Formatting in Python
191Getting Epoch Time in Python
192Getting Date from epoch format in Python
193Converting epoch format to struct object_time in Python
194Getting a struct object_time UTC in Python
195Getting epoch format from struct_time in Python
196Epoch Difference in Python
197Delaying an Operation in Python
User defined functions
198