Skip to content

Latest commit

 

History

History

README.md

Python Learning - Functions and Modularity

Overview

This module covers Python functions, including their definition, scope, arguments, and advanced features like lambdas and functional programming concepts.

Lessons

Lesson 3.1: Defining Functions

  • Function definition and calling
  • Parameters and arguments
  • Return values
  • Docstrings
  • Function scope

Lesson 3.2: Scope and Arguments

  • Variable scope (local, global, nonlocal)
  • Positional and keyword arguments
  • Variable-length arguments (*args, **kwargs)
  • Argument unpacking
  • Function annotations

Lesson 3.3: Lambdas and Functional Programming

  • Lambda functions
  • map() function
  • filter() function
  • List comprehensions
  • Functional programming concepts

Lesson 3.4: Task Manager Functions v2

  • Function-based task management
  • Modular code organization
  • Function composition
  • Error handling
  • Type hints

Learning Objectives

  • Understand Python function syntax and features
  • Learn about variable scope and arguments
  • Master functional programming concepts
  • Build a more modular task manager

Key Differences from Java

  • def keyword instead of return type
  • No parameter types
  • Optional return values
  • Docstrings for documentation
  • First-class functions
  • No method overloading
  • Variable number of arguments
  • Keyword arguments
  • Argument unpacking
  • Function annotations (type hints)

Prerequisites

  • Completed Data Structures module
  • Understanding of basic programming concepts
  • Familiarity with Python syntax and data structures

Next Steps

After completing this module, proceed to Object-Oriented Programming in Python to learn about classes and objects.