Author(s): Mark Lassoff; Julius Hernandez
Year: 2018
Chapter 1 – Introduction
Intended Audience
What Does the Book Cover?
Important Things to Remember
Chapter 2 – Getting Started
Downloading and Installing Python
Running IDLE
Writing Your First Python Program
Running the Program
Editing your First Program
Using the Shell Window
To Change the Editor’s Various Font-Related Features
To Change the Editor’s Highlighted Text Colors
To Use the Shell in Interactive Mode
Writing Code in the Editor Window
Executing Python on the Command Line
Coding Exercise: Writing, Running and Debugging
Chapter 3 – Output
The print() Function
Separators and Newlines
Coding Exercise: Using the print() Function
Chapter 4 – Variables
Variable Assignment
Number Variables (int, float, and complex)
That wraps up our section on number variables. You will learn about string variables next.
String Variables
Substrings and Concatenation
Variables with Lists, Tuples, and Dictionaries
Coding Exercise: Using Variables
Chapter 5 – Operators
Mathematical Operators
Order of Operations
Comparison Operators
Logical Operators
Coding Exercise: Operators Practice
Chapter 6 – Code Branching
Simple If Statements
If…Else Statements
Nested If Statements
The Ternary Operator
Coding Exercise: Operators Practice
Chapter 7 – Loops
The While Loop
The For Loop
Nested Loops
Break and Continue Statements
Coding Exercise: Loops
Chapter 8 – Math Functions
Casting Functions
Mathematical Functions
Random Functions
Coding Exercise: Math Functions
Chapter 9 – String Functions
The capitalize (), center (), and count () functions
The find (), isalpha (), and isdigit () functions
The join (), len (), and split () functions
Coding Exercise: String Functions
Chapter 10 – Tuples and Dictionaries
Creating Tuples
Accessing Values in Tuples
Printing specific values from a tuple
Looping through a Tuple
Tuple Functions
What are lists?
The len() Function
Using the len() Function to Loop through a Tuple
The min() and max() Functions
You can use the min() and max() functions to return the minimum and maximum values in a tuple. Let’s try to show this using an example.
Converting a List to a Tuple
Declaring a Dictionary
Accessing and Editing Values in Dictionaries
Printing specific values from a dictionary
Changing the elements in a dictionary
Deleting an element in a dictionary
Dictionary Functions
The len() Function
The str() Function
The clear() Function
The get function
The items function
The values function
The keys function
Getting the Elements and Key-Value Pairs in a Dictionary
Coding Exercise: String Functions
Chapter 11 – Time and Date
The Time Tuple
The Calendar
The Time and Calendar Functions
Coding Exercise: Functions
Chapter 12 – Python Functions
Defining and Calling a Simple Function
Required Argument Functions
Keyword Argument Functions
Default Function Arguments
Return Statement
Creating and Consuming Python Modules
Coding Exercise: Functions
Chapter 13 – Input and Output
Reading Keyboard Input
Reading an External Text File
Writing an External Text File
Coding Exercise: File I/O
Chapter 14 – More with Python
Handling Exceptions
Web Server Coding with Python
Processing Form Data with Python
Wrap Up and Goodbye