Rapid Python 3 Training for Experienced Programmers (PYT538)
Course Length: 5 days
Delivery Methods:
Available as private class only
Course Overview
This course combines our Introduction to Python and Advanced Python training classes. It is for experienced programmers who are new to Python, but will be able to pick it up fast.
Course Benefits
- How Python works.
- Python's place in the world of programming languages.
- Python literals.
- Python comments.
- Variables and Python data types.
- Simple modules.
- Outputting data with print().
- Collecting user input.
- Defining and calling functions.
- Parameters and arguments.
- Default values for parameters.
- Variable scope.
- Return values.
- Creating and importing modules.
- Basic math in Python.
- The math module.
- The random module.
- String basics.
- Special characters.
- Multi-line strings.
- Indexing and slicing strings.
- Common string operators and methods.
- Formatting strings.
- Built-in string functions.
- Types of iterables available in Python.
- Lists.
- Tuples.
- Ranges.
- Dictionaries.
- Sets.
- The *args and **kwargs parameters.
- Creating virtual environments.
- Activating and deactivating virtual environments.
- Installing packages with pip.
- Sharing project requirements so others can create a matching virtual environment.
- Deleting a virtual environment.
- if conditions in Python.
- Loops in Python.
- Generator functions.
- List comprehensions.
- Handling exceptions in Python.
- The time module.
- The datetime module.
- Reading files.
- Creating and writing to files.
- Working with directories.
- Working with the os and os.path modules.
- PEP8.
- Pylint.
- Lambda functions.
- Advanced list comprehensions.
- The collections module.
- Mapping and filtering.
- Sorting sequences.
- Unpacking sequences in function calls.
- Modules and packages.
- Understanding regular expressions.
- Python's re module.
- Data stored in a relational database.
- Data stored in a CSV file.
- Data from a web page.
- HTML, XML, and JSON.
- Accessing an API.
- Testing performance with timers and the timeit module.
- The unittest module.
- Classes and objects in Python.
- Instance methods, class methods, and static methods.
- Properties.
- Decorators.
- Subclasses and inheritance.
Course Outline
- 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)
- 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
Class Materials
Each student will receive a comprehensive set of materials, including course notes and all the class examples.
Class Prerequisites
Experience in the following would be useful for this Python class:
- Some programming experience.