Python Essentials Training (PYT438)
This Python training course offers a comprehensive introduction to Python, a versatile and powerful programming language widely used in web development, data analysis, artificial intelligence, and more. Designed for beginners and those looking to deepen their understanding of Python, this course covers everything from basic syntax to advanced concepts like object-oriented programming, file handling, and working with data.
The course begins with Python Basics, where you will learn how to set up your development environment, run Python scripts, and write simple programs. You will explore fundamental concepts such as literals, variables, constants, and functions. You’ll also practice writing Python modules, working with user inputs, and performing file operations, with exercises to reinforce your understanding.
Next, you’ll dive into Functions and Modules, where you’ll discover how to define functions, manage variable scope, and use parameters effectively. This module covers importing and organizing code with modules and differentiates between functions and methods, helping you understand the building blocks of Python programming.
The Math module introduces Python’s arithmetic and assignment operators, as well as built-in math functions and modules like math
and random
. You’ll work through exercises to understand the precedence of operations and apply mathematical concepts to solve practical problems.
In the Python Strings module, you’ll explore string manipulation techniques such as indexing, slicing, concatenation, and formatting. The module also covers Python’s immutable string nature, common string methods, and advanced string formatting with f-strings, with hands-on exercises to solidify your skills.
You’ll then learn about Iterables: Sequences, Dictionaries, and Sets, focusing on lists, tuples, ranges, dictionaries, and sets. This module includes exercises on sequence indexing, slicing, and unpacking, as well as using Python’s built-in functions to manipulate and transform data collections.
The Virtual Environments, Packages, and pip module will teach you how to manage dependencies, create isolated development environments, and install packages using pip
. You’ll practice setting up and managing virtual environments, essential for professional Python development.
The Flow Control module covers conditional statements, loops, and control flow techniques. You’ll learn to use if
, else
, elif
, for
, and while
loops, as well as loop control mechanisms like break
and continue
. The exercises in this module will enhance your ability to write efficient, logical code.
Exception Handling will teach you how to manage errors gracefully in your Python programs. You’ll learn about exception basics, handling multiple exceptions, using try
, except
, else
, and finally
clauses, and raising custom exceptions. Practical exercises will help you build robust applications that handle unexpected situations effectively.
The Python Dates and Times module focuses on working with date and time data using Python’s time
and datetime
modules. You’ll learn to manipulate time objects, format date strings, and perform time-based calculations.
In File Processing, you’ll explore methods for opening, reading, writing, and manipulating files. This module includes practical exercises on working with text files, using the os
module for file operations, and managing file paths efficiently.
The course also covers PEP8 and Pylint, Python’s style guide and linting tools, helping you write clean, readable, and maintainable code.
In Advanced Python Concepts, you’ll explore lambda functions, list comprehensions, the collections
module, and other advanced topics. You’ll practice sorting data, working with mutable and immutable objects, and utilizing advanced data structures.
You’ll then learn about Regular Expressions, which allow you to search and manipulate text using patterns. This module includes hands-on exercises to help you master regex syntax and apply it to practical tasks.
The Working with Data module covers data handling techniques, including working with CSV, XML, JSON, and SQLite databases. You’ll learn to read, write, and manipulate different data formats, scrape data from the web, and connect to databases using Python.
Testing and Debugging introduces you to testing strategies and debugging tools. You’ll learn to use the unittest
module to write automated tests and debug your code effectively.
Finally, the Classes and Objects module provides a deep dive into object-oriented programming. You’ll learn to create and manage classes and objects, use inheritance, work with private and static methods, and document your code. Exercises will help you understand how to build complex, reusable components in Python.
By the end of this course, you’ll have a solid foundation in Python programming, enabling you to build applications, manipulate data, and automate tasks with confidence. You’ll be well-prepared to tackle more advanced Python topics and apply your skills in a wide range of professional environments.
- Write Python scripts with confidence.
- Code with ease using Python Standard Library script modules.
- Complete math operations with Python.
- Access data in a Python program using string indexing and slicing strings.
- Leverage data structures like sequences, dictionaries, and sets.
- Use flow control tools to manage the execution of your program.
- Strengthen your code with exception handling, testing, and debugging.
- Quickly match, locate, and manage text using regular expressions.
- Handle date and time with confidence.
- Read, write, and edit files using Python.
- Create reusable code to save time later.
- Work with various data sources.
- Use Python's object-oriented features to create flexible code that is easier to maintain.
- Python Basics
- Getting Familiar with the Terminal
- Running Python
- Running a Python File
- Exercise: Hello, world!
- Literals
- Exercise: Exploring Types
- Variables
- Exercise: A Simple Python Script
- Constants and Deleting Variables
- Writing a Python Module
- print() Function
- Collecting User Input
- Exercise: Hello, You!
- Reading from and Writing to Files
- Exercise: Working with Files
- Functions and Modules
- Defining Functions
- Variable Scope
- Global Variables
- Function Parameters
- Exercise: A Function with Parameters
- Returning Values
- Exercise: Parameters with Default Values
- Returning Values
- Importing Modules
- Methods vs. Functions
- Math
- Arithmetic Operators
- Exercise: Floor and Modulus
- Assignment Operators
- Precedence of Operations
- Built-in Math Functions
- The math Module
- The random Module
- Exercise: How Many Pizzas Do We Need?
- Exercise: Dice Rolling
- Python Strings
- Quotation Marks and Special Characters
- String Indexing
- Exercise: Indexing Strings
- Slicing Strings
- Exercise: Slicing Strings
- Concatenation and Repetition
- Exercise: Repetition
- Combining Concatenation and Repetition
- Python Strings are Immutable
- Common String Methods
- String Formatting
- Exercise: Playing with Formatting
- Formatted String Literals (f-strings) (introduced in Python 3.6)
- Built-in String Functions
- Exercise: Outputting Tab-delimited Text
- Iterables: Sequences, Dictionaries, and Sets
- Definitions
- Sequences
- Lists
- Sequences and Random
- Exercise: Remove and Return Random Element
- Tuples
- Ranges
- Converting Sequences to Lists
- Indexing
- Exercise: Simple Rock, Paper, Scissors Game
- Slicing
- Exercise: Slicing Sequences
- min(), max(), and sum()
- Converting between Sequences and Strings
- Unpacking Sequences
- Dictionaries
- The len() Function
- Exercise: Creating a Dictionary from User Input
- Sets
- *args and **kwargs
- Virtual Environments, Packages, and pip
- Exercise: Creating, Activiting, Deactivating, and Deleting a Virtual Environment
- Packages with pip
- Exercise: Working with a Virtual Environment
- Flow Control
- Conditional Statements
- Compound Conditions
- The is and is not Operators
- all() and any() and the Ternary Operator
- In Between
- Loops in Python
- Exercise: All True and Any True
- break and continue
- Looping through Lines in a File
- Exercise: Word Guessing Game
- The else Clause in Loops
- Exercise: for...else
- The enumerate() Function
- Generators
- List Comprehensions
- Exception Handling
- Exception Basics
- Generic Exceptions
- Exercise: Raising Exceptions
- The else and finally Clauses
- Using Exceptions for Flow Control
- Exercise: Running Sum
- Raising Your Own Exceptions
- Python Dates and Times
- Understanding Time
- The time Module
- Time Structures
- Times as Strings
- Time and Formatted Strings
- Pausing Execution with time.sleep()
- The datetime Module
- datetime.datetime Objects
- Exercise: What Color Pants Should I Wear?
- datetime.timedelta Objects
- Exercise: Report on Departure Times
- File Processing
- Opening Files
- Exercise: Finding Text in a File
- Writing to Files
- Exercise: Writing to Files
- Exercise: List Creator
- The os Module
- os.walk()
- The os.path Module
- A Better Way to Open Files
- Exercise: Comparing Lists
- PEP8 and Pylint
- PEP8
- Pylint
- Advanced Python Concepts
- Lambda Functions
- Advanced List Comprehensions
- Exercise: Rolling Five Dice
- Collections Module
- Exercise: Creating a defaultdict
- Counters
- Exercise: Creating a Counter
- Mapping and Filtering
- Mutable and Immutable Built-in Objects
- Sorting
- Exercise: Converting list.sort() to sorted(iterable)
- Sorting Sequences of Sequences
- Creating a Dictionary from Two Sequences
- Unpacking Sequences in Function Calls
- Exercise: Converting a String to a datetime.date Object
- Modules and Packages
- Regular Expressions
- Regular Expression Tester
- Regular Expression Syntax
- Python's Handling of Regular Expressions
- Exercise: Green Glass Door
- Working with Data
- Virtual Environment
- Relational Databases
- Passing Parameters
- SQLite
- Exercise: Querying a SQLite Database
- SQLite Database in Memory
- Exercise: Inserting File Data into a Database
- Drivers for Other Databases
- CSV
- Exercise: Finding Data in a CSV File
- Creating a New CSV File
- Exercise: Creating a CSV with DictWriter
- Getting Data from the Web
- Exercise: HTML Scraping
- XML
- JSON
- Exercise: JSON Home Runs
- Testing and Debugging
- Testing for Performance
- Exercise: Comparing Times to Execute
- The unittest Module
- Exercise: Fixing Functions
- Special unittest.TestCase Methods
- Classes and Objects
- Attributes
- Behaviors
- Classes vs. Objects
- Attributes and Methods
- Exercise: Adding a roll() Method to Die
- Private Attributes
- Properties
- Exercise: Properties
- Objects that Track their Own History
- Documenting Classes
- Exercise: Documenting the Die Class
- Inheritance
- Exercise: Extending the Die Class
- Extending a Class Method
- Exercise: Extending the roll() Method
- Static Methods
- Class Attributes and Methods
- Abstract Classes and Methods
- Understanding Decorators
Each student will receive a comprehensive set of materials, including course notes and all the class examples.
Experience in the following would be useful for this Python class:
- Some programming experience.
Live Private Class
- Private Class for your Team
- Live training
- Online or On-location
- Customizable
- Expert Instructors