Skip to content

practice-python-for-beginners/python-functions-and-modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Python Functions and Modules

Welcome to python-functions-and-modules, part of the practice-python-for-beginners series.

This repository helps learners understand how to write and use Python functions and organize reusable code into modules.


πŸ“š Topics Covered

  • Defining and calling functions
  • Function arguments (positional, keyword, default, *args, **kwargs)
  • Return values
  • Importing modules (import, from ... import)
  • Using built-in and custom modules

🧩 Repository: python-functions-and-modules

Purpose:
Teach learners about defining and calling functions, passing arguments, returning values, using built-in and custom modules, and writing modular, reusable Python code.


πŸ—‚ Directory Structure

python-functions-and-modules/
β”‚
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”‚
β”œβ”€β”€ exercises/
β”‚   β”œβ”€β”€ defining_functions.py
β”‚   β”œβ”€β”€ arguments_and_returns.py
β”‚   β”œβ”€β”€ custom_module_example.py
β”‚   β”œβ”€β”€ importing_modules.py
β”‚   └── tests/
β”‚       β”œβ”€β”€ test_defining_functions.py
β”‚       β”œβ”€β”€ test_arguments_and_returns.py
β”‚       β”œβ”€β”€ test_importing_modules.py
β”‚
└── requirements.txt

βš™οΈ Setup Instructions

  1. Clone this repository:

    git clone https://github.com/practice-python-for-beginners/python-functions-and-modules.git
    cd python-functions-and-modules
  2. Create and activate a virtual environment (optional):

    python -m venv venv
    source venv/bin/activate   # Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Run tests to validate your understanding:

    pytest

🧠 Learning Outcomes

By working through these exercises, you will learn:

  • How to define and call Python functions
  • Importance of parameters and return values
  • How to import and use standard and user-defined modules
  • How modular Python code improves readability and reusability

🧾 License

This codebase is licensed under the GNU General Public License v3 (GPLv3).
See LICENSE for details.


About

python-functions-and-modules

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages