Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Practical Programming, Third Edit ion
About the Pragmatic Bookshelf
Table of Contents
What Readers Are Saying about Practical Programmi ng
Acknowledgments
Preface
Our Approach
Further Reading
What You’ll See
Online Resources
Chapter 1: What’s Programming?
Programs and Programming
What’s a Programming Language?
What’s a Bug?
The Difference Between Brackets, Braces, and Parentheses
Installing Python
Chapter 2: Hello, Python
How Does a Computer Run a Python Pro gram?
Expressions and Values: Arithmetic in Python
What Is a Type?
Variables and Computer Memory: Reme mbering Values
How Python Tells You Something Went Wro ng
A Single Statement That Spans Mult iple Lines
Describing Code
Making Code Readable
The Object of This Chapter
Exercises
Chapter 3: Designing and Using Functions
Functions That Python Provides
Memory Addresses: How Python Keeps Track of Values
Defining Our Own Functions
Using Local Variables for Temporary Storage
Tracing Function Calls in th e Memory Model
Designing New Functions: A Recipe
Writing and Running a Program
Omitting a return Statement: None
Dealing with Situations Tha t Your Code Doesn’t Handle
What Did You Call That?
Exercises
Chapter 4: Working with Text
Creating Strings of Characters
Using Special Characters in Strings
Creating a Multiline String
Printing Information
Getting Information from the Keyb oard
Quotes About Strings
Exercises
Chapter 5: Making Choices
A Boolean Type
Choosing Which Statements to Exec ute
Nested if Statements
Remembering Results of a Boolean Expres sion Evaluation
You Learned About Booleans: True or Fa lse?
Exercises
Chapter 6: A Modular Approach to Program Organization
Importing Modules
Defining Your Own Modules
Testing Your Code Semiautomatically
Tips for Grouping Your Functions
Organizing Our Thoughts
Exercises
Chapter 7: Using Methods
Modules, Classes, and Methods
Calling Methods the Object-Oriented Way
Exploring String Methods
What Are Those Underscores?
A Methodical Review
Exercises
Chapter 8: Storing Collections of Data Using Lists
Storing and Accessing Data in Lists
Type Annotations for Lists
Modifying Lists
Operations on Lists
Slicing Lists
Aliasing: What’s in a Name?
List Methods
Working with a List of Lists
A Summary List
Exercises
Chapter 9: Repeating Code Using Loops
Processing Items in a List
Processing Characters in Strings
Looping Over a Range of Numbers
Processing Lists Using Indices
Nesting Loops in Loops
Looping Until a Condition Is Reache d
Repetition Based on User Input
Controlling Loops Using break and continue
Repeating What You’ve Learned
Exercises
Chapter 10: Reading and Writing Files
What Kinds of Files Are There?
Opening a File
Techniques for Reading Files
Files over the Internet
Writing Files
Writing Example Calls Using Strin gIO
Writing Algorithms That Use t he File-Reading Techniques
Multiline Records
Looking Ahead
Notes to File Away
Exercises
Chapter 11: Storing Data Using Other Collection Types
Storing Data Using Sets
Storing Data Using Tuples
Storing Data Using Dictionaries
Inverting a Dictionary
Using the in Operator on Tuples, Sets, a nd Dictionaries
Comparing Collections
Creating New Type Annotations
A Collection of New Information
Exercises
Chapter 12: Designing Algorithms
Searching for the Two Smallest Values
Timing the Functions
At a Minimum, You Saw This
Exercises
Chapter 13: Searching and Sorting
Searching a List
Binary Search
Sorting
More Efficient Sorting Algori thms
Merge Sort: A Faster Sorting A lgorithm
Sorting Out What You Learned
Exercises
Chapter 14: Object-Oriented Programming
Understanding a Problem Domain
Function isinstance, Class object, and C lass Book
Writing a Method in Class Book
Plugging into Python Syntax: Mo re Special Methods
A Little Bit of OO Theory
A Case Study: Molecules, Atoms, and PDB Fil es
Classifying What You’ve Learned
Exercises
Chapter 15: Testing and Debugging
Why Do You Need to Test?
Case Study: Testing above_fr eezing
Case Study: Testing running_sum
Choosing Test Cases
Hunting Bugs
Bugs We’ve Put in Your Ear
Exercises
Chapter 16: Creating Graphical User Interfaces
Using Module tkinter
Building a Basic GUI
Models, Views, and Controllers, Oh My!
Customizing the Visual Style
Introducing a Few More Widgets
Object-Oriented GUIs
Keeping the Concepts from Being a GUI M ess
Exercises
Chapter 17: Databases
Overview
Creating and Populating
Retrieving Data
Updating and Deleting
Using NULL for Missing Data
Using Joins to Combine Tables
Keys and Constraints
Advanced Features
Some Data Based On What You Learned
Exercises
Bibliography
You May Be Interested In…
← Prev
Back
Next →
← Prev
Back
Next →