Python Functions, Modules, and Packages

Beginner
1m
3,755
4.2/5

This lesson provides you with a deep dive into how to refactor and structure your code into smaller, more manageable building blocks using functions, modules, and packages.

Learning Objectives

  • Understand how to write and define functions.
  • Understand the four kinds of different function input parameters and how to use them.
  • Review how modules are created and used.
  • Learn how modules are loaded using the import statement.
  • Examine how modules are discovered via module search locations.
  • Review how modules can themselves be organised into packages.
  • And finally, we understand how to use aliases for both module and package names.

Prerequisites

  • A basic understanding of the Python programming language.
  • A basic understanding of software development.
  • A basic understanding of the software development life cycle.

Intended Audience

  • Software developers interested in learning how to write Python code in a Pythonic way.
  • Python junior level developers interested in advancing their Python skills.
  • Anyone with an interest in Python and how to use Python to write concise and elegant scripts for general purpose tasks.
About the Author
Avatar
Jeremy Cook, opens in a new tab
Content Lead Architect
Students
160,524
Labs
80
Courses
108
Learning paths
213

Jeremy is a Content Lead Architect and DevOps SME here at Cloud Academy where he specializes in developing DevOps technical training documentation.

He has a strong background in software engineering, and has been coding with various languages, frameworks, and systems for the past 25+ years. In recent times, Jeremy has been focused on DevOps, Cloud (AWS, Azure, GCP), Security, Kubernetes, and Machine Learning.

Jeremy holds professional certifications for AWS, Azure, GCP, Terraform, Kubernetes (CKA, CKAD, CKS).

Covered Topics