
Explore hands-on topics beyond the basics and intermediate concepts to build scalable Python applications, master practical and theoretical techniques, and boost your career as a productive Python programmer.
Explore Python topics from iterators and scope to decorators, mastering string formatting, generators, regular expressions, collections, packaging, and math and statistics modules.
Learn how python iterators work and how to obtain an iterator from an iterable like a tuple, then use next to print items such as lemon, orange, banana.
Learn to create an iterator from a string and retrieve each character with next, using iter('orange') and successive next calls to display all six characters.
Learn how to loop through iterables using for loops in Python, iterating over tuples, lists, and strings to print each item or character.
Learn to build a simple Python iterator by implementing the __iter__ and __next__ methods, initialize with __init__, and return the instance and the next item in the sequence.
Build a numbers class with a next method to return the next item in the sequence, instantiate it, and print items from one to seven using the next method.
Create a Python generator that yields numbers starting from one, increments each time, and stops after 17 items by raising a StopIteration exception inside the next method.
Explore Python scope by distinguishing local scope from global scope and see how variables defined inside a function, like i equals 90, are accessible only within that function.
Explore inner functions in Python by creating an inner function inside an outer function, demonstrating scope rules, local variables, and why the inner function is not defined globally.
Explore global scope in Python by showing a global variable accessible inside a function, with a local shadow yielding 50 inside and 70 globally.
Explore how the global keyword in Python promotes a variable from local to global scope, allowing modification of global variables inside functions and preventing scope errors.
Learn how to format strings in Python using the format builtin method, control placeholders with braces, and display numbers with two decimals, as shown with degree = 25.
Learn how to add multiple values to Python's format method using variables like quantity, item number, and price, format placeholders, and display a two-decimal dollar amount.
Master index numbers in string formatting with placeholders to place values by their positions. Apply the format method to reuse variables by index and produce formatted outputs.
Use named indexes in Python string formatting by naming placeholders and passing values by name, illustrated with BMW and X5 in a format method example.
Explore how Python generators create iterators using the yield statement to emit a sequence of values. Build and test a simple generator function, use next to retrieve each item.
Understand how the return keyword differs from yield in generators; using return terminates the function and stops iteration after the first yield, illustrating stop iteration and terminal behavior.
Understand how generator functions in Python use a for loop and range to produce values, pause execution, and resume with next while preserving local scope and handling stop iteration.
Create a Python generator named squared sequence that yields the square of each number in a range using yield, next, and for loops, illustrating stop iteration handling.
Learn to traverse elements over a generator using a for loop instead of next, with automatic stop iteration handling, by implementing a square sequence generator and printing each square.
Explore generator expressions as a concise alternative to full generator functions, and learn to pass them without parentheses into built-in functions like sum, using range and the math module.
Learn how to use regular expressions in Python with the re module, importing re, calling search to match patterns, and using if statements to report a match (yes or no).
Learn Python's regular expression module, using findall to return all matches, search for match, split strings at matches, and sub to replace patterns with meta characters, character classes, and sequences.
Learn how to handle no matches by returning an empty list and using an if-else to display 'match' or 'no match' when string comparisons yield no results, demonstrated with 'Brazil'.
Use Python's re module to search a string for the first whitespace character and return a match object. It prints the first whitespace position, starting from zero.
Explore None in Python, the NoneType object, and how searches return None when no match is found, with all None assignments sharing the same object.
Learn how to use Python's regular expression split to return a list split at each match, including splitting by whitespace and controlling occurrences with the max parameter.
Learn how the sub function in Python's regular expressions replaces whitespace with a chosen text, demonstrated by replacing spaces with the number nine in a string.
Learn to control the number of replacements by specifying a count parameter; change the count and the symbol, and the vertical symbol prints only for the first three white spaces.
Learn to use the regular expression module to locate first match of a word starting with an uppercase letter and retrieve its start and end positions from the match object.
Explore Python's regular expression module by using the search and group functions to return the part of the string where there was a match, print results, and handle no-match cases.
Learn to use Python's collections module and its namedtuple to create objects with named fields such as name, age, and country, access values by attribute or index, and print them.
Learn how the Python standard library's collections module uses ordered dictionaries to preserve insertion order, iterate items, and display key-value pairs with readability.
Use the Python collections deque to add and remove items from either end with append, appendleft, pop, and popleft, and note its memory efficiency over a normal list.
Explore how Python packages organize modules and files, create a package named my package with greeting and math modules, and implement add, average, and power functions.
Learn how to import a module from a package using from ... import ..., and call functions like power, sum, and average.
Discover how a folder becomes a Python package via an init module that exports functions such as power, average, and greeting, enabling import from scripts or the interpreter.
Install a package globally using the setup tools module and setup function, then verify by running the package in a terminal and calling its average function.
Explore the Python math module, exposing underlying C library functions for floating point math and standard functions, note that some do not support complex numbers, and see cosine of pi/4.
Explore logarithms with base 2, calculating log(1024) equals 10, and learn to use Python's random module to select a random item from a list (banana, apple, lemon) with random.choice.
Explore how to use Python's random module to generate numbers and samples, including sampling without replacement from a range of 100 and selecting 10 items, plus generating random floats.
Explore the Python statistics module and learn to compute mean, median, and variance of numeric data using the built-in functions on a sample data list.
Explore how Python decorators wrap functions to add functionality and return modified functions, illustrating metaprogramming and higher-order functions where functions are objects bound to names.
Learn how to create higher order functions by passing functions as arguments, with examples of incrementing and discriminating functions, and an operating function that applies them.
Explore higher order functions in Python by returning an inner function and invoking it. See how the returned function prints hello from the inner example.
Discover how Python decorators take in a function, add functionality, and return a new callable that executes the original function.
Learn how a decorator adds functionality to a function in Python by placing the symbol along with the decorator name New Pretty above the function definition, creating a decorated function.
Explore a two-parameter division function and observe that dividing by zero yields a zero division error, illustrating the issue when y equals zero.
Explore decorating functions with parameters using a decorator and an inner function to handle division by zero, returning the wrapped function and illustrating X and Y.
Hi, Welcome to the Python Programming Beyond The Basics And Intermediate Training.
In this course, you will get a hands-on Many important topics that need to be mastered in order to create applications of multiple scales and purposes in Python programming language.
By the end of this course, you’ll have the Intermediate concepts that every Python developer should have, and know how to use them practically in all the fields of the Python language.
Even if you are in any field such as data science, web development or machine learning, it is very necessary to know all the concepts that we will talk about in this course, as well as how to use them in a theoretical and practical way as we will do, and this is in order to facilitate the creation of programs in the correct way as you want it without wasting time or complication.
We created this course for you if you want to boost your Python career to become a productive Python programmer .
What are the topics that we will discuss in this course?
First, we will talk about iterators in the Python language, how to use them, the concepts and functions related to them, how to create them, and what is the purpose of creating them easily.
Simply, Iterator in Python is simply an object that can be iterated upon. An object which will return data, one element at a time.
This is a brief and simple definition of Python iterator.
Let's go to the second section, which we will talk about.
In the second section we will talk about The Python scope Of all kinds and how to deal with them.
Not all variables or functions can be accessed from anywhere in a program. The part of a program where a variable or function is accessible is called its scope.
The section that next, we'll talk about the string formatting To make sure a string will display as expected . and You’ll learn about these formatting techniques in detail and add them to your Python string formatting toolkit.
And in the fourth section we will know all about:
What generators in Python are and how to use them
How to build generator functions and expressions
How the Python yield statement works and the difference between yield and return.
How to use multiple Python yield statements in a generator function.
How to use advanced generator methods in your apps.
The section that next, you’ll learn everything about regular expressions in Python.
This is a very important topic, and we will talk about it in a detailed and practical way and with deep clarification. Actually, You’ll have all power of regular expressions, You will work with the re library, deal with pattern matching, and many more.
Basically, Regular Expressions are a tool for matching patterns in text. This is a brief and simple definition of Regular Expressions.
In the next section, you’ll master the most commonly used data structures from the Python collections module.
Basically, Collections in Python are containers that are used to store collections of data, for example, lists and dictionaries. These are built-in collections. Several modules have been developed that provide additional data structures to store collections of data. One such module is the Python collections module.
The collections module is used to improve the functionalities of the built-in collection containers.
The next section walks you through how to package a simple Python project. It will show you how to add the necessary files and structure to create the package, how to build the package, and how to use this Package.
In the next section, you’ll master all about math and statistics modules practically, and the functions that are used with them.
Simply, the math module provides access to the mathematical functions defined by the C standard. and The statistics module provides functions for calculating mathematical statistics of numeric data.
Finally, In the last part of this course you will learn something very important, which is decoration.
In this section on decorators, we’ll look at what they are and how to create and use them in detail.
Simply and By definition, a decorator is a function that takes another function and extends the behavior of the latter function without explicitly modifying it. that’s it . We will simplify this topic very without complication, and with practical examples to illustrate.