In this live, instructor-led training course, students who already have a programming background will learn to program in Python. Attendees will learn: how Python works and its place in the world of programming languages; to work with and manipulate strings; to perform math operations; to work with Python sequences; to collect user input and output results; flow control processing; to write to, and read from, files; to write functions; to handle exception; and work with dates and times. This Python course is taught using Python 3. Differences between Python 2 and Python 3 are noted.
Audience
Students new to the Python language who already have experience with other programming languages.
Prerequisites
This course is specially designed for individuals with prior programming background. You should also have a working knowledge of Object Oriented Programming concepts. If you have no prior programming experience or are not familiar with Object Oriented Programming, you should consider our "Python Programming Level 1: Introduction for Non-Programmers" course instead.
Course Outline
Vital Python – Math, Strings, Conditionals, and Loops
- Vital Python
- Numbers: Operations, Types, and Variables
- To Open a Jupyter Notebook
- Python as a Calculator
- Standard Math Operations
- Basic Math Operations
- Order of Operations
- Spacing in Python
- Number Types: Integers and Floats
- Complex Number Types
- Errors in Python
Variables
- Variable Assignment
- Changing Types
- Reassigning Variables in Terms of Themselves
- Variable Names
- Multiple Variables
- Comments
- Docstrings
- Theorem in Python
Strings: Concatenation, Methods, and input()
- String Syntax
- Escape Sequences with Quotes
- Multi-Line Strings
- The print() Function
- String Operations and Concatenation
- String Interpolation
- Comma Separators
- Format
- The len() Function
- String Methods
- Casting
- The input() Function
- String Indexing and Slicing
- Indexing
- Slicing
Strings and Their Methods
- Booleans and Conditionals
- Booleans
- Logical Operators
- Comparison Operators
- Comparing Strings
- Conditionals
- The if Syntax
- Indentation
- if else
- The elif Statement
- Loops
- The while Loops
- An Infinite Loop
- break
- Programs
- The for Loop
- The continue Keyword
Python Structures
- The Power of Lists
- List Methods
- Accessing an Item from a List
- Adding an Item to a List
- Dictionary Keys and Values
- a List and a Dictionary
- Zipping and Unzipping Dictionaries Using zip()
- Dictionary Methods
- Tuples
- A Survey of Sets
- Set Operations
- Choosing Types
Executing Python – Programs
- Algorithms, and Functions
- Introduction
- Python Scripts and Modules
- Shebangs in Ubuntu
- Docstrings
- Imports
- The if __name__ == "__main__" Statement
- Basic Functions
- Positional Arguments
- Keyword Arguments
- Iterative Functions
- Exiting Early
- Activity 10: The Fibonacci Function with an Iteration
- Helper Functions
- Don't Repeat Yourself
- Variable Scope
- Variables
- Defining inside versus outside a Function
- The Global Keyword
- The Nonlocal Keyword
- Lambda Functions
- Mapping with Lambda Functions
- Filtering with Lambda Functions
- Sorting with Lambda Functions
Extending Python, Files, Errors, and Graphs
- Reading Files
- Writing Files
- the Date and Time in a Text File