Packt
Advanced Python Features and Functions

Discover new skills with $120 off courses from industry experts. Save now.

Packt

Advanced Python Features and Functions

Included with Coursera Plus

Gain insight into a topic and learn the fundamentals.
Intermediate level

Recommended experience

2 weeks to complete
at 10 hours a week
Flexible schedule
Learn at your own pace
Gain insight into a topic and learn the fundamentals.
Intermediate level

Recommended experience

2 weeks to complete
at 10 hours a week
Flexible schedule
Learn at your own pace

What you'll learn

  • Master advanced Python functions like lambdas, decorators, and error handling.

  • Learn how to manage function arguments, including mutable and immutable objects.

  • Understand the practical applications of sequence unpacking and comprehensions.

  • Gain confidence in using Python's more advanced techniques to write cleaner, more efficient code.

Details to know

Shareable certificate

Add to your LinkedIn profile

Recently updated!

September 2025

Assessments

23 assignments

Taught in English

See how employees at top companies are mastering in-demand skills

 logos of Petrobras, TATA, Danone, Capgemini, P&G and L'Oreal

Build your subject-matter expertise

This course is part of the Python - Complete Python, Django, Data Science and ML Guide Specialization
When you enroll in this course, you'll also be enrolled in this Specialization.
  • Learn new concepts from industry experts
  • Gain a foundational understanding of a subject or tool
  • Develop job-relevant skills with hands-on projects
  • Earn a shareable career certificate

There are 21 modules in this course

In this module, we will dive into Python functions, explaining their structure and purpose in organizing code. You'll also discover how to call functions, distinguish between parameters and arguments, and explore Python's flexibility with return values and optional parameters. The module wraps up with an introduction to creating concise, one-liner functions in Python.

What's included

3 videos2 readings1 assignment1 plugin

In this module, we will delve into the different types of function arguments in Python, from mutable and immutable objects to positional arguments. You'll get hands-on practice with essential concepts like *args and learn how to manage both mandatory and optional arguments. The module concludes with a challenge to build a function that combines two lists into a dictionary, reinforcing your understanding of function argument handling.

What's included

5 videos1 assignment1 plugin

In this module, we will explore the versatile capabilities of *args and **kwargs in Python functions. You’ll learn how to manage varying numbers of positional and keyword arguments, which enhances your functions' flexibility and readability. Through practical exercises and tasks, you'll gain hands-on experience combining these techniques to create dynamic and reusable functions.

What's included

8 videos1 assignment1 plugin

In this module, we will focus on default function parameters and how they enhance the flexibility of your functions. You’ll learn how to set default values for parameters, making them optional, and see how this can be combined with positional and keyword arguments to create versatile functions. Hands-on practice will reinforce how to effectively use default parameters in real-world scenarios.

What's included

2 videos1 assignment1 plugin

In this module, we will explore the essential practice of documenting Python code using docstrings. You'll learn how to effectively document your functions, classes, and modules, providing clear descriptions for parameters and return values. We’ll also cover how to implement type hints and best practices for writing docstrings that make your code more accessible to other developers, ensuring maintainability and clarity.

What's included

4 videos1 assignment1 plugin

In this module, we will dive into callback functions and their role in enabling one function to be passed as an argument to another. You'll learn how this technique helps in separating concerns and allowing delayed execution. Additionally, we'll explore best practices for function naming and design to create clean, testable, and reusable code.

What's included

2 videos1 assignment1 plugin

In this module, we will explore the concept of variable scopes in Python, distinguishing between global and local variables. You'll learn how to use the "global" keyword to modify global variables inside functions and understand when and how to use it effectively. Through practical examples, you'll gain a deeper understanding of variable precedence and best practices for avoiding conflicts in your code.

What's included

4 videos1 assignment1 plugin

In this module, we will explore the different types of operators in Python, from arithmetic to logical, and understand their role in forming expressions. You’ll gain clarity on unary and binary operators and their impact on variables and objects. Through hands-on tasks, you'll learn how to apply comparison operators and check element presence in collections like sets, reinforcing your understanding of Python’s operator system.

What's included

4 videos1 assignment1 plugin

In this module, we will explore the concept of falsy and truthy values in Python, focusing on how certain values like 0, False, None, and empty sequences are treated as "false" in conditional statements. You'll also learn about truthy values and how to use these distinctions in your code to streamline logical operations and condition evaluations.

What's included

2 videos1 assignment1 plugin

In this module, we will dive into Python's logical and comparison operators. You'll learn how logical operators work, with a focus on short-circuit evaluation, and how to combine them effectively using parentheses. The module also covers comparison operators for making decisions based on conditions and introduces the "del" statement for removing elements from mutable sequences, expanding your knowledge of Python’s decision-making tools.

What's included

7 videos1 assignment1 plugin

In this module, we will dive into the world of Lambda functions, exploring their syntax and practical use-cases in Python. You'll learn how to return Lambda functions from other functions, enabling dynamic function creation, and see how to use them for tasks like sorting and filtering lists. Through hands-on examples, you'll understand the versatility and efficiency Lambda functions bring to Python development.

What's included

4 videos1 assignment1 plugin

In this module, we will explore Python’s error-handling mechanisms, focusing on the try-except block, as well as the use of else and finally for more control over error handling. You'll also learn to handle multiple types of errors, raise custom errors, and handle specific scenarios like file not found or undefined variables. Through hands-on exercises, you'll gain confidence in managing errors gracefully, ensuring your programs run smoothly even when unexpected situations arise.

What's included

10 videos1 assignment1 plugin

In this module, we will explore the power of sequence unpacking in Python, which allows you to extract values from lists, tuples, and dictionaries directly into variables. You'll learn how to handle different unpacking scenarios, including nested sequences and remaining or selected elements, to simplify your code. Additionally, we will show you how to use unpacking in function calls to pass values as positional and keyword arguments seamlessly.

What's included

8 videos1 assignment1 plugin

In this module, we will explore the dictionary unpacking operator (**) in Python, showing you how to create and modify dictionaries without altering the originals. You'll learn how to merge multiple dictionaries and control the order of key-value pairs, making it easier to manage settings and configurations. Practical examples will help you master the flexibility and power of dictionary unpacking in your Python projects.

What's included

3 videos1 assignment1 plugin

In this module, we will explore Python's conditional statements, focusing on how to use if, elif, and else effectively in your code. You’ll learn how to structure conditions, utilize logical operators, and understand the importance of evaluating expressions. Practical examples, including functions for calculating discounts and school grades, will help you refine your conditional logic skills and improve your Python coding efficiency.

What's included

10 videos1 assignment1 plugin

In this module, we will dive into the ternary operator in Python, showing you how to use it to write concise conditional expressions. You'll learn how to apply it for tasks like toggling user statuses, calculating discounts, and processing data with more efficient conditional logic. Through practical examples, you'll see how the ternary operator can simplify your code and handle complex conditions in a single line.

What's included

5 videos1 assignment1 plugin

In this module, we will explore Python's "for-in" loop, focusing on how to iterate over a variety of sequences like lists, tuples, dictionaries, sets, and strings. You'll learn how to efficiently unpack tuples and use the "range" function within loops. Practical exercises will help you master the flexibility of the "for-in" loop, empowering you to work with diverse data structures and solve real-world problems with ease.

What's included

6 videos1 assignment1 plugin

In this module, we will dive into Python's "while" loop, exploring its condition-based iteration and key differences from the "for-in" loop. You’ll learn how to control loops with the "continue" and "break" statements and how to use "while" loops in practical scenarios, including managing user inputs and creating interactive programs. Hands-on tasks will help you build a solid understanding of controlling flow and handling user-driven decisions in your Python applications.

What's included

6 videos1 assignment1 plugin

In this module, we will explore Python's powerful "for-in" comprehensions, which allow you to create concise, efficient code for transforming and filtering sequences. You'll learn how to use comprehensions for lists, sets, and dictionaries, applying them to real-world examples like converting lists to tuples and merging sequences into dictionaries. Hands-on exercises will help you grasp the full potential of comprehensions, including advanced techniques like nested and conditional comprehensions for more complex tasks.

What's included

11 videos1 assignment1 plugin

In this module, we will dive into Python generators, exploring how they provide memory-efficient solutions for working with large datasets. You’ll learn the differences between generators and sequences like lists and tuples, and see hands-on examples demonstrating their advantages. Practical exercises will help you master iteration over generators and understand their behavior, especially when re-iterating over them.

What's included

2 videos1 assignment1 plugin

In this module, we will dive into Python's decorator functions, which allow you to enhance or modify functions in a clean and modular way. You’ll learn how decorators work with *args and **kwargs for argument handling and see practical examples, like adding security checks or logging functionality. Through hands-on examples, you'll discover how decorators improve the flexibility and maintainability of your code.

What's included

4 videos1 reading3 assignments1 plugin

Earn a career certificate

Add this credential to your LinkedIn profile, resume, or CV. Share it on social media and in your performance review.

Instructor

Packt - Course Instructors
Packt
920 Courses198,803 learners

Offered by

Packt

Explore more from Software Development

Why people choose Coursera for their career

Felipe M.
Learner since 2018
"To be able to take courses at my own pace and rhythm has been an amazing experience. I can learn whenever it fits my schedule and mood."
Jennifer J.
Learner since 2020
"I directly applied the concepts and skills I learned from my courses to an exciting new project at work."
Larry W.
Learner since 2021
"When I need courses on topics that my university doesn't offer, Coursera is one of the best places to go."
Chaitanya A.
"Learning isn't just about being better at your job: it's so much more than that. Coursera allows me to learn without limits."
Coursera Plus

Open new doors with Coursera Plus

Unlimited access to 10,000+ world-class courses, hands-on projects, and job-ready certificate programs - all included in your subscription

Advance your career with an online degree

Earn a degree from world-class universities - 100% online

Join over 3,400 global companies that choose Coursera for Business

Upskill your employees to excel in the digital economy

Frequently asked questions