Python Fundamentals
Strengthen Python programming capability through a practical 3-day program covering core scripting, functions, files, modules, object-oriented programming, and real-world automation techniques.
Duration
3 Days
Overview
This 3-day Python fundamentals program expands core scripting skills with functions, file handling, exceptions, modules, object-oriented programming, and practical automation techniques.
Introduction
Python is a flexible and productive programming language used across automation, scripting, data handling, backend systems, and technical problem solving. This 3-day program builds on Python fundamentals by introducing structured code reuse, file handling, exception management, modules, classes, and practical text-processing techniques in a balanced instructor-led format.
Topics Covered
- An Overview of Python
- Getting Started
- Flow Control
- Sequence Data
- Defining Functions
- Functional Programming
- Working with Files
- Dictionaries and Sets
- Errors and Exception Handling
- Python Classes
- Using Modules
- Regular Expressions
- Highlights of the Standard Library
Audience Profile
Anyone who needs to learn how to write programs in Python, as well as participants who want strong practical exposure to Python as a first or early programming language.
Prerequisites
There are no formal prerequisites for this course, but some programming background is preferred.
Day 1 - Python Foundations and Core Language Skills
1. An Overview of Python
- What is Python
- Interpreted languages
- Advantages and disadvantages
- Downloading and installing
- Choosing a Python version
- Where to find documentation
- Running Python scripts
- Structure of a Python script
- Interactive interpreter
- Script execution
2. Getting Started
- Using variables
- String types
- String operations
- Arithmetic expressions
- Writing to the screen
- Command line parameters
- Reading from the keyboard
3. Flow Control
- About flow control
- Indentation in Python
- The if statement
- The elif statement
- while loops
- The for statement
- The range() function
- Sequence iteration
- enumerate()
- zip()
4. Sequence Data
- Lists
- Tuples
- Sets
- Dictionaries
- Array slicing
- Sequence operations
- List unpacking
- List comprehensions
- all() and any()
5. Lab 1: Python Basics and Program Flow
- Variables and expressions
- Strings and formatted output
- Conditionals and loops
- Sequence data practice
Day 2 - Functions, Files, Data Structures, and Reusable Code
6. Defining Functions
- Function definition syntax
- Formal parameters
- Optional parameters
- Keyword arguments
- Variable-length arguments
- Global and local scope
- Passing parameters
- Passing lists
- Returning values
- Returning lists
- Facilitating code reuse
7. Functional Programming
- Lambda functions
- map()
- filter()
- reduce()
- Function arguments
- Higher-order functions
8. Working with Files
- Text file I/O overview
- Opening a text file
- Reading text files
- Writing to text files
- Working with raw binary data
- Using the pickle module
- Opening Excel files
- Reading from Excel files
- Excel write operations
9. Dictionaries and Sets
- Dictionary overview
- Creating dictionaries
- Dictionary functions
- Fetching keys and values
- Membership testing
- Deleting elements
10. Errors and Exception Handling
- Dealing with syntax errors
- Exceptions
- try/except
- Cleaning up with finally
- Exception-safe code
11. Lab 2: File Handling and Functional Programming Practice
- Reusable I/O functions
- Read and write text files
- Excel data processing
- Exception handling practice
Day 3 - Modules, OOP, Regular Expressions, and Practical Python Use
12. Python Classes
- OOP concepts
- Defining classes
- Class methods and data
- Constructors
- Objects and instance methods
- Instance data
- Destructors
- Interfaces
- Inheritance
13. Using Modules
- What is a module
- The import statement
- Function aliases
- Packages
- pip and PyPI packages
- sys, math, and time
14. Regular Expressions
- Regex pattern matching
- Parsing data
- Subexpressions
- Complex substitutions
- Regex techniques
15. Highlights of the Standard Library
- os module basics
- Grabbing web pages
- Sending email
- glob patterns
- Working with math and random
- datetime module
- Compressed files
16. Lab 3: Practical Python Automation Project
- Classes and modules
- Regex text processing
- Standard library automation
- Mini Python utility