
Master the advanced foundations of Python programming, including named tuples, default dictionaries, queues and deques, iterators, generators, and decorators, with practical real-world examples.
Explore named tuples in Python, a lightweight container that lets you assign names to tuple positions by importing from collections and using a type name and field names.
Import namedtuple from the collections module and define a point2D with fields x and y, then instantiate it with x=50 and y=100 to compare to a regular tuple. Use isinstance to confirm the type, and perform slicing, indexing, and pecking operations on the named tuple.
Explore Python named tuples by unpacking points, formatting with placeholders, indexing, iterating, and using rename to create valid field names and access fields via _fields.
Explore how the default dict from the collections module, a subclass of the dictionary class, supplies default values for absent keys in Python, and how the default factory works.
import defaultdict from collections and use a default dict to auto-assign values using a default factory for missing keys, such as zero or an empty set or list.
Explore counters in Python, learn how Counter from collections counts items in iterables, and see practical syntax by calling Counter(iterable) to tally elements in lists, tuples, dictionaries.
Import the Counter from the collections module and build a Counter from a list, a string, or a dictionary to count item frequencies. Print the results.
Learn to use Python's Counter to count items from tuples and strings, update counts with iterables, delete items by key, and understand that Counter is a dict subclass.
Learn how OrderedDict preserves insertion order in Python by using OrderedDict from the collections module, unlike regular dictionaries, to track item order when iterating.
Import OrderedDict from collections and create an empty ordered dictionary; convert a normal dictionary to an OrderedDict and print its items to see the preserved order.
Explore manipulating an ordered dictionary in Python 3 by adding, updating, and deleting items in a sample order; move items to ends and iterate in reverse.
Discover how to use Python's queue library to implement a first in, first out queue, creating it with from queue import queue and using put and get.
Learn how to use Python's deque from the collections module to create a queue, append items, pop from the left, and clear the container.
Explore the Python zip function to zip and unzip iterables, returning an iterator of tuples. Learn the syntax, passing one or multiple iterables, with practical examples.
Demonstrate how the zip function combines two iterables into a for-loop of tuples, and note that no-argument zip yields an empty iterator while a single iterable yields single value tuples.
Zip multiple iterables in Python to create tuples from integers, strings, and another list; unzip with the asterisk and use zip longest from itertools to extend to the longest.
Learn how to use Python's built-in eval function to evaluate a given expression, optionally with global and local dictionaries to control the execution scope.
Learn how eval function evaluates Python expressions from strings, with examples like 10 to the power of 2 equals 100. See how variables and the global parameter influence evaluation.
Learn how Python's eval uses globals and locals dictionaries to evaluate expressions, define X and Y, and compute X plus Y, which yields 15.
Explore memory view in Python to expose the buffer protocol safely and access internal buffers with a memory view object.
Create a bytes object, convert it to a memory view, print its memory reference and type, and use the tolist method to display ascii values of the bytes.
Explore memory view usage in Python with a budgetary object, showing how indexing reveals ascii values. Convert memory view to bytes and use slicing to inspect types and values.
Explore the map built-in function in Python to apply a function to every item of an iterable, returning an iterator; learn its syntax and how it handles multiple iterables.
Explore mapping objects in python by applying a custom addition function to a five-item list with map, yielding 15, 25, 35, 45, 55, and demonstrate two-iterable maps and tuple conversion.
Explore how to use lambda functions with map to cube elements from five to thirty, convert map results to lists, and multiply elements from two iterables.
Learn how the enumerate function returns index and value tuples for each item in an iterable. It accepts an optional start parameter that defaults to zero.
Explore how Python's enumerate creates index name tuples from a names list and converts the result to a list with the list() function, using the optional start parameter.
Learn to use enumerate with for loops to pair each item in a names list with its zero-based index and name, and see how next() yields (index, value).
Learn how the Python exec function, a built-in method, executes code from a string or code object with three parameters: code, globals, and locals, with optional dictionaries, through practical examples.
Learn how to use Python's built-in exec to run code blocks and strings, execute statements, and display results with print, including examples with variables, input, and list comprehensions.
Learn how the exec function runs code and built in functions in Python, including using the square root from the math module and managing globals via a dictionary.
Learn about args and kwargs in Python, including using asterisk args for a flexible number of positional parameters and double asterisks for keyword parameters stored in a dictionary.
Learn how to use the *args parameter in Python to define a function that sums a variable number of arguments using a for loop.
Learn how the double asterisk kwargs lets a Python function accept an arbitrary number of arguments, build and print a dictionary of key-value pairs using the format method.
Learn how Python iterators initialize and iterate, returning an iterator object and using the next method to fetch items, stopping with StopIteration to end the loop.
Learn to create and use iterators and iterables in Python by implementing the iter method for lists and strings, using next to fetch items, and handling stop iteration with try/except.
Learn to build a custom iterator for iterables using a class, implementing a next method to yield values from zero to fifteen and using stop iteration to prevent infinite loops.
Explore Python generator functions that create iterators for multiple values in a for loop. A generator cannot include a return statement; return terminates, while it pauses and preserves internal state.
Define a generator function using yield to return values and maintain state as an iterator. Call next to retrieve values or use a for loop to iterate until stop iteration.
Practice building generators and using the for loop to print the squares of numbers from zero to eleven in Python, using range semantics, then compare list comprehension with generator expressions.
Learn how metaclasses define the behavior of class objects in Python, using the built-in type metaclass and building custom metaclasses from the ground up.
Define a Python class with the class keyword, instantiate objects, and show that a class is an instance of the type metaclass; create classes in one line with type.
Explore creating and using metaclasses in python, including defining a custom metaclass from the ground up with numata, creating objects from a class, and inspecting their metaclass.
Explore how decorators in Python act as a design pattern to add or modify functionality for functions and classes, using the @ symbol to apply a decorator before definitions.
Learn how to define simple Python functions, specify headers and parameters, and return values. Explore nesting functions, calling them, passing functions as arguments, and returning a function for flexible composition.
explore how closures let inner functions access outer scope and how decorators transform functions, using a sample that uppercases text with a decorator and the @ syntax.
Explore Python list comprehension to create new lists from existing ones with a concise, efficient syntax, and compare it to the regular approach to save time.
Learn to create Python lists and filter items using list comprehension with for item in fruits list and if I in item to build my list.
Transform a character-by-character string iteration into a single line list comprehension that builds a new list, replacing the traditional for loops and showcasing concise Python power.
Explore dictionary comprehension in Python, a concise method to build dictionaries from lists or sequences using a for loop and zip for pairing keys and values, including conditional examples.
Master set comprehension in Python by building sets from iterables with curly braces and for loops. Use optional if conditions and range examples to generate squares and filtered numbers.
Explore tuple comprehension in Python by using a generator expression inside tuple(), creating tuples from iterables with optional conditions, illustrated by filtering numbers to get 2, 4, 6.
Learn to build a logger in Python using the logging module to track events during program execution and diagnose issues. Understand five log levels: debug, info, warning, error, and critical.
Explore building a calendar with Python using the built-in calendar module. Import the calendar module and leverage its simple, powerful functions to manage calendar operations.
Import the calendar module and use its month function to print a month for a given year, and generate html calendars while checking leap days and leap years.
Hello and welcome to the Advanced Foundations of Python Programming | 2023 Training Masterclass.
Learn the Advanced foundations of modern python programming with this powerful, deep, direct to the point and interactive training.
For each concept in this course, you'll master the theory then you'll practice with many real examples.
Do you want to Advance your Python development career?
Do you want to be able to create real programs using the advanced concepts of Python?
This effective training course is created for you to help you master the most important advanced concepts in python programming language, and it will save your valuable time.
By the end of this course you'll learn:
Advanced Collections: Named Tuples, Default Dictionary, Counters, Ordered Dictionary, Queues and Deques.
Advanced Functions: Zipping, Unzipping, Evaluating expressions, Memory view, Mapping objects with lambda, Enumerating objects and Executing Python expressions.
The *args and **kwargs to pass variable number of args.
Iterators and Iterables in Python: Iterate over sequences using different techniques and tricks.
Building Iterators using FP and OOP.
Generator functions with many yield statements and Generator expressions.
Metaclass: Built-in metaclasses and building custom metaclass.
Decorators: Functional Programming, Regular way to decorate a function, and the best way using @.
Comprehensions: List comprehension, Dict comprehension, Set comprehension and Tuple comprehension.
Building Logger to indicate the problems.
Creating custom Calendar with different ways.
This advanced training course is full of examples to clarify each concept in detail.
You'll master all that and more, and if you encounter any problems during this course, you'll get the QA Instructor support as soon as possible.
Learn, understand, practice and master the advanced foundations of the python programming language like python experts .
So, what are you waiting for, enroll now to go through this advanced and deep Training of the most popular Programming Language on the market, Python.
Become An Advanced Python Guru in no time!
Let’s get started!