100% found this document useful (1 vote)
5 views

Python Programming in Context, Fourth Edition Julie Anderson And Jon Anderson instant download

The document is an overview of the book 'Python Programming in Context, Fourth Edition' by Julie and Jon Anderson, detailing its content structure, including chapters on various programming topics such as data types, file I/O, image processing, and simulation. It also provides links to additional resources and related books available for download. The book is published by Jones & Bartlett Learning and includes information on copyright and contact details for the publisher.

Uploaded by

lipesshaidhe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
5 views

Python Programming in Context, Fourth Edition Julie Anderson And Jon Anderson instant download

The document is an overview of the book 'Python Programming in Context, Fourth Edition' by Julie and Jon Anderson, detailing its content structure, including chapters on various programming topics such as data types, file I/O, image processing, and simulation. It also provides links to additional resources and related books available for download. The book is published by Jones & Bartlett Learning and includes information on copyright and contact details for the publisher.

Uploaded by

lipesshaidhe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Python Programming in Context, Fourth Edition

Julie Anderson And Jon Anderson download

https://textbookfull.com/product/python-programming-in-context-
fourth-edition-julie-anderson-and-jon-anderson/

Download more ebook from https://textbookfull.com


We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!

Fracture Mechanics: Fundamentals and Applications,


Fourth Edition Ted L. Anderson

https://textbookfull.com/product/fracture-mechanics-fundamentals-
and-applications-fourth-edition-ted-l-anderson/

Response surface methodology process and product


optimization using designed experiments Fourth Edition
Anderson-Cook

https://textbookfull.com/product/response-surface-methodology-
process-and-product-optimization-using-designed-experiments-
fourth-edition-anderson-cook/

Anderson s Atlas of Hematology Third Edition Shauna C


Anderson Young Keila B Poulsen

https://textbookfull.com/product/anderson-s-atlas-of-hematology-
third-edition-shauna-c-anderson-young-keila-b-poulsen/

Fundamentals of clinical psychopharmacology Anderson

https://textbookfull.com/product/fundamentals-of-clinical-
psychopharmacology-anderson/
The comet assay in toxicology 2nd Edition Diana
Anderson

https://textbookfull.com/product/the-comet-assay-in-
toxicology-2nd-edition-diana-anderson/

Susan B Anderson s Kids Knitting Workshop The Easiest


and Most Effective Way to Learn to Knit Anderson

https://textbookfull.com/product/susan-b-anderson-s-kids-
knitting-workshop-the-easiest-and-most-effective-way-to-learn-to-
knit-anderson/

Derrida Ethics Under Erasure Nicole Anderson

https://textbookfull.com/product/derrida-ethics-under-erasure-
nicole-anderson/

Introduction to Probability David F. Anderson

https://textbookfull.com/product/introduction-to-probability-
david-f-anderson/

En avant!: beginning French Second Edition Anderson

https://textbookfull.com/product/en-avant-beginning-french-
second-edition-anderson/
World Headquarters
Jones & Bartlett Learning
25 Mall Road
Burlington, MA 01803
978-443-5000
info@jblearning.com
www.jblearning.com
Jones & Bartlett Learning books and products are available through most
bookstores and online booksellers. To contact Jones & Bartlett Learning directly,
call 800-832-0034, fax 978-443-8000, or visit our website, www.jblearning.com.

Substantial discounts on bulk quantities of Jones & Bartlett Learning


publications are available to corporations, professional associations, and other
qualified organizations. For details and specific discount information, contact the
special sales department at Jones & Bartlett Learning via the above contact
information or send an email to specialsales@jblearning.com.

Copyright © 2025 by Jones & Bartlett Learning, LLC, an Ascend Learning


Company
All rights reserved. No part of the material protected by this copyright may be
reproduced or utilized in any form, electronic or mechanical, including
photocopying, recording, or by any information storage and retrieval system,
without written permission from the copyright owner.
The content, statements, views, and opinions herein are the sole expression of the
respective authors and not that of Jones & Bartlett Learning, LLC. Reference
herein to any specific commercial product, process, or service by trade name,
trademark, manufacturer, or otherwise does not constitute or imply its
endorsement or recommendation by Jones & Bartlett Learning, LLC and such
reference shall not be used for advertising or product endorsement purposes. All
trademarks displayed are the trademarks of the parties noted herein. Python
Programming in Context, Fourth Edition is an independent publication and has not
been authorized, sponsored, or otherwise approved by the owners of the
trademarks or service marks referenced in this product.
There may be images in this book that feature models; these models do not
necessarily endorse, represent, or participate in the activities represented in the
images. Any screenshots in this product are for educational and instructive
purposes only. Any individuals and scenarios featured in the case studies
throughout this product may be real or fictitious but are used for instructional
purposes only.
28325-9
Production Credits
Vice President, Product Management: Marisa R. Urbano
Vice President, Content Strategy and Implementation: Christine Emerton
Director, Product Management: Matthew Kane
Director, Content Management: Donna Gridley
Manager, Content Strategy: Orsolya Gall
Content Strategist: Sara Holloway
Content Coordinator: Samantha Gillespie
Director, Project Management and Content Services: Karen Scott
Manager, Project Management: Jackie Reynen
Project Manager: Jennifer Risden
Senior Digital Project Specialist: Angela Dooley
Product Marketing Manager: Mark Adamiak
Content Services Manager: Colleen Lamy
Senior Director of Supply Chain: Ed Schneider
Manufacturing Buyer: Bob Valentine
Composition: Straive
Cover Design: Briana Yates
Media Development Editor: Faith Brosnan
Rights & Permissions Manager: John Rusk
Rights Specialist: James Fortney
Cover Image (Title Page, Part Opener, Chapter Opener): © Yuri
Hoyda/Shutterstock
Printing and Binding: Gasch Printing, LLC
Library of Congress Cataloging-in-Publication Data
Names: Anderson, Julie, 1947- author. | Anderson, Jon. Python programming in
context.
Title: Python programming in context / Julie Anderson, Jon Anderson.
Description: Fourth edition. | Burlington, Massachusetts : Jones & Bartlett
Learning, [2025] | Includes index. |
Identifiers: LCCN 2023054476 | ISBN 9781284283211 (paperback)
Subjects: LCSH: Python (Computer program language)
Classification: LCC QA76.73.P98 M544 2025 | DDC 005.13/3–dc23/eng/20231213
LC record available at https://lccn.loc.gov/2023054476
6048
Printed in the United States of America
28 27 26 25 24 10 9 8 7 6 5 4 3 2 1
For my husband, Tom; my sons, Brian and Jon; my daughters-in-law, Silvia and
Laurel; and my grandchildren, Wren, Ben, and Reyna

– JAA

For my wife, Laurel, and my kids, Wren and Reyna

– JTA
© Yuri Hoyda/Shutterstock.

Brief Contents

Preface
Acknowledgments

CHAPTER 1 Introduction to Python

CHAPTER 2 Playing by the Rules

CHAPTER 3 Codes and Other Secrets

CHAPTER 4 Introducing the Python Collections

CHAPTER 5 Bigger Data: File I/O

CHAPTER 6 Image Processing

CHAPTER 7 Data Mining: Cluster Analysis

CHAPTER 8 Cryptanalysis

CHAPTER 9 Fractals: The Geometry of Nature


CHAPTER 10 Planet Objects

CHAPTER 11 Simulation

CHAPTER 12 A Hierarchy of Shapes

CHAPTER 13 Interactive Games


Appendix A: Installing the Required Software
Appendix B: Python Quick Reference
Appendix C: turtle Reference
Appendix D: Answers to Selected Try It Out Exercises
Glossary
Index
© Yuri Hoyda/Shutterstock.

Contents

Preface
Acknowledgments

CHAPTER 1 Introduction to Python


1.1 Objectives
1.2 What Is Computer Science?
1.3 Why Study Computer Science?
1.3.1 Everyday Applications of Computer Science
1.3.2 Why Computer Science Is Important
1.4 Problem-Solving Strategies
1.5 Python Overview
1.5.1 Primitive Elements
1.5.2 Naming Objects
1.5.3 Abstraction
1.5.4 Repetition
1.6 Summary
Key Terms
Programming Exercises

CHAPTER 2 Playing by the Rules


2.1 Objectives
2.2 The Chatbot
2.3 The String Data Type
2.4 Making Decisions
2.4.1 Boolean Expressions
2.4.2 Compound Boolean Expressions and Logical Operators
2.4.3 Selection Statements
2.5 Implementing the Chatbot
2.6 Playing Games
2.6.1 Guess a Number
2.6.2 The while Loop
2.6.3 Printing Numbers in Strings
2.6.4 Asking for Input
2.7 Completing Guess a Number
2.8 Validating User Input
2.9 Counting the Guesses
2.9.1 The Accumulator Pattern
2.10 The Game of Nim
2.10.1 Random Numbers
2.10.2 Returning a Value from a Function
2.11 Summary
Key Terms
Programming Exercises

CHAPTER 3 Codes and Other Secrets


3.1 Objectives
3.2 The String Data Type
3.2.1 Repetition
3.2.2 Indexing
3.2.3 String Slicing
3.2.4 String Searching
3.2.5 String Methods
3.2.6 Character Functions
3.3 Encrypting and Decrypting Messages
3.4 Transposition Cipher
3.4.1 Encrypting Using Transposition
3.4.2 Decrypting a Transposed Message
3.5 Substitution Cipher
3.6 Creating a Key
3.7 The Vigenère Cipher
3.8 Summary
Key Terms
Programming Exercises

CHAPTER 4 Introducing the Python Collections


4.1 Objectives
4.2 What Is Data?
4.3 Storing Data for Processing
4.3.1 Strings Revisited
4.3.2 Lists
4.4 Calculating Statistics on Data
4.4.1 Simple Dispersion
4.5 Central Tendency
4.5.1 Mean
4.5.2 Median
4.5.3 Mode
4.6 Frequency Distribution
4.6.1 Using a Dictionary to Compute a Frequency Table
4.6.2 Computing a Frequency Table Without a Dictionary
4.6.3 Visualizing a Frequency Distribution
4.7 Dispersion: Standard Deviation
4.8 Summary
Key Terms
Programming Exercises

CHAPTER 5 Bigger Data: File I/O


5.1 Objectives
5.2 Using Files for Large Data Sets
5.2.1 Text Files
5.2.2 Iterating over Lines in a File
5.2.3 Writing a File
5.2.4 String Formatting
5.2.5 Alternative File-Reading Methods
5.3 Reading Data from the Internet
5.3.1 Using CSV Files
5.3.2 Using a while Loop to Read a File
5.3.3 List Comprehension
5.4 Reading and Manipulating Data with pandas
5.4.1 pandas Data Structures
5.4.2 Reading CSV Data with pandas
5.4.3 Data Manipulation with pandas
5.5 Reading JSON Data from the Internet
5.6 Correlating Data
5.7 Summary
Key Terms
Programming Exercise

CHAPTER 6 Image Processing


6.1 Objectives
6.2 What Is Digital Image Processing?
6.2.1 The RGB Color Model
6.2.2 The cImage Module
6.3 Basic Image Processing
6.3.1 Negative Images
6.3.2 Grayscale
6.3.3 A General Solution: The Pixel Mapper
6.4 Parameters, Parameter Passing, and Scope
6.4.1 Call by Assignment Parameter Passing
6.4.2 Namespaces
6.4.3 Calling Functions and Finding Names
6.4.4 Modules and Namespaces
6.5 Advanced Image Processing
6.5.1 Resizing
6.5.2 Stretching: A Different Perspective
6.5.3 Flipping an Image
6.5.4 Edge Detection
6.6 Summary
Key Terms
Programming Exercises

CHAPTER 7 Data Mining: Cluster Analysis


7.1 Objectives
7.2 What Is Data Mining?
7.3 Cluster Analysis: A Simple Example
7.4 Implementing Cluster Analysis on Simple Data
7.4.1 Distance Between Two Points
7.4.2 Clusters and Centroids
7.4.3 The K-Means Cluster Analysis Algorithm
7.4.4 Implementation of K-Means
7.4.5 Implementation of K-Means, Continued
7.5 Implementing Cluster Analysis: Earthquakes
7.5.1 File Processing
7.5.2 Visualization
7.6 Cluster Analysis Shortcomings and Solutions
7.7 Summary
Key Terms
Programming Exercises

CHAPTER 8 Cryptanalysis
8.1 Objectives
8.2 Introduction
8.3 Cracking the Rail Fence
8.3.1 Checking Our Work with a Dictionary
8.3.2 A Brute-Force Solution
8.3.3 A Rail Fence Decryption Algorithm
8.4 Cracking the Substitution Cipher
8.4.1 Letter Frequency
8.4.2 Ciphertext Frequency Analysis
8.4.3 Letter Pair Analysis
8.4.4 Word Frequency Analysis
8.4.5 Pattern Matching with Partial Words
8.4.6 Regular Expression Summary
8.5 Summary
Key Terms
Programming Exercises

CHAPTER 9 Fractals: The Geometry of Nature


9.1 Objectives
9.2 Introduction
9.3 Recursive Programs
9.3.1 Recursive Squares
9.3.2 Classic Recursive Functions
9.3.3 Drawing a Recursive Tree
9.3.4 The Sierpinski Triangle
9.3.5 Call Tree for a Sierpinski Triangle
9.4 Snowflakes, Lindenmayer, and Grammars
9.4.1 L-Systems and the match Statement
9.4.2 Automatically Expanding Production Rules
9.4.3 More Advanced L-Systems
9.5 Summary
Key Terms
Programming Exercises

CHAPTER 10 Planet Objects


10.1 Objectives
10.2 Introduction
10.2.1 Focusing on Data
10.2.2 Object-Oriented Programming
10.2.3 Python Classes
10.3 Designing and Implementing a Planet Class
10.3.1 Constructor Method
10.3.2 Accessor Methods
10.3.3 Mutator Methods
10.3.4 Special Methods
10.3.5 Methods and self
10.3.6 Details of Method Storage and Lookup
10.4 Designing and Implementing a Sun Class
10.5 Designing and Implementing a Solar System
10.6 Animating the Solar System
10.6.1 Using Turtles
10.6.2 Planetary Orbits
10.6.3 Implementing the Simulation
10.7 Summary
Key Terms
Programming Exercises

CHAPTER 11 Simulation
11.1 Objectives
11.2 Bears and Fish
11.3 What Is a Simulation?
11.4 Rules of the Game
11.5 Design
11.6 Implementation
11.6.1 The World Class
11.6.2 The Fish Class
11.6.3 The Bear Class
11.6.4 Main Simulation
11.7 Growing Plants
11.8 A Note on Inheritance
11.9 Summary
Key Terms
Programming Exercises

CHAPTER 12 A Hierarchy of Shapes


12.1 Objectives
12.2 Introduction
12.3 First Design
12.4 Basic Implementation
12.4.1 The Canvas Class
12.4.2 The GeometricObject Class
12.4.3 The Point Class
12.4.4 The Line Class
12.4.5 Testing Our Implementation
12.5 Understanding Inheritance
12.6 Limitations
12.7 An Improved Implementation
12.8 Implementing Polygons
12.9 Summary
Key Terms
Programming Exercises

CHAPTER 13 Interactive Games


13.1 Objectives
13.2 Introduction
13.2.1 Event-Driven Programming
13.2.2 Simulating an Event Loop
13.2.3 A Multithreaded Event Loop
13.3 Event-Driven Programming with the Turtle
13.3.1 A Simple Drawing Using Key Presses
13.3.2 Placing Turtles Using Mouse Clicks
13.3.3 Bouncing Turtles
13.4 Creating Your Own Video Game
13.4.1 The LaserCannon Class
13.4.2 The BoundedTurtle Class
13.4.3 The Drone Class
13.4.4 The Bomb Class
13.4.5 Putting All the Pieces Together
13.5 Summary
Key Terms
Programming Exercises
Appendix A: Installing the Required Software
Appendix B: Python Quick Reference
Appendix C: turtle Reference
Appendix D: Answers to Selected Try It Out Exercises
Glossary
Index
© Yuri Hoyda/Shutterstock.

Preface

Introduction
Computer science deals with people who have problems to solve.
Algorithms help find the solutions to those problems. To be a
computer scientist means first and foremost that you are a problem
solver, capable of constructing algorithms either from scratch or by
applying patterns from past experience.
The only way to be successful in learning computer science is
through deliberate and incremental exposure to the fundamental
ideas of the discipline. A beginning student of computer science
needs practice to establish a thorough understanding of concepts
before continuing on to the more complex parts of the curriculum. In
addition, a beginner needs the opportunity to be successful and to
gain confidence. As students progress through the introductory
computer science sequence, we want them to focus on aspects of
problem-solving, algorithm development, and algorithm
understanding.
In this text, we use Python as the programming language because
it has a clean, simple syntax and an intuitive user environment. The
basic collections are powerful yet easy to use. The interactive nature
of the language creates a place to test ideas without the need for a
lot of coding. Finally, Python provides a textbook-like notation for
representing algorithms, alleviating the need for an additional layer
of pseudocode. This allows the illustration of many relevant,
modern, and interesting problems that make use of algorithms.

Key Features
This text is designed to be a first course in computer science that
focuses on problem-solving, with language features being introduced
as needed to solve the problem at hand. We have structured the text
around problems of general interest, rather than a traditional
language-element structure. Thus, you will not see chapter titles in
this text like “Loops” and “Conditionals”—but you will see chapter
titles such as “Planet Objects” and “Playing by the Rules.”
Throughout the text, concepts are introduced using a spiral model.
Because the syntax of Python is easy to learn, we can quickly
introduce the basics of standard programming constructs. As
students progress through the text, more of the details and
background for these constructs are added to their toolbox. In this
way, students are exposed to important computer science concepts
at the point when those concepts are needed to solve a problem.
An illustration of how this spiral approach touches on a specific
topic in different ways can be seen in our presentation of functions.
Students begin to write functions with parameters in Chapter 1.
Chapter 2 then introduces functions with return values. In Chapter 6,
students learn about passing functions as parameters to other
functions and the details of Python’s scoping rules. In Chapter 8,
they encounter Python’s keyword and optional parameters. Chapter
9 covers recursive functions. In Chapter 10, students learn about
writing functions that are methods of a class. In Chapter 12,
students learn to write abstract methods. Finally, in Chapter 13,
students are introduced to writing callback functions for event-driven
programming.
Pedagogical Aids
Throughout the text, pedagogical aids emphasize Python
programming constructs and good programming practices as they
are introduced to solve problems. In this way, the text can be
approached both from a problem-solving view and as a Python
reference.
These pedagogical aids include:

Tables that summarize each newly introduced function or


method.

TABLE 2.8 The input Function

Function Description
input(prompt) Outputs the prompt, then returns a string containing any characters
typed by the user when the user presses enter or return. The enter
or return key is not part of the returned string.

Recap boxes that summarize important concepts.

RECAP:
A list is a sequential collection of heterogenous objects. Lists are
written as commadelimited values enclosed in square brackets.

Heads Up boxes that alert students to possible pitfalls, and


provide techniques for avoiding errors.

HEADS UP:
Be careful to update the while loop condition in the loop body to
avoid an infinite loop.
Good Programming Practice boxes that provide problem-solving
strategies as well as tips for writing readable and maintainable
code.

GOOD PROGRAMMING PRACTICE:


Wherever possible, verify that input from the user is valid. If not
valid, allow the user to reenter the input.

Python code that is color-coded so the student can better see


syntax elements.

Description

Figures that are presented in color, which is important for


several turtle applications and image-processing programs in
which color is used to highlight variations in data.
© Luka Hercigonja/Shutterstock.
What’s New in the Fourth Edition
The Fourth Edition contains many updates and new features found
in Python version 3.10.

In response to instructor and student feedback, we replaced


Chapter 2. The new chapter, Playing by the Rules, covers the
same programming topics as the previous Chapter 2 while
solving problems that are more engaging to students. Using
rules-based programming, the student develops a chatbot and
teaches the computer strategies to play games. We also
introduce the while loop here so that students can write event-
controlled loops in addition to the for loops introduced in
Chapter 1. In previous editions, while loop construction was
spread throughout multiple chapters. Similarly, we introduce the
input function here (previously introduced in Chapter 3) for
ease in playing the games.
For the development system, we now use the popular, freely
available Jupyter Notebook. All sessions and listings in the book
have been written using Jupyter Notebook.
In Chapter 4, Introducing the Python Collections, we introduce
the matplotlib library as a means to graph data.
In Chapter 5, Bigger Data: File I/O, we introduce the pandas
library for reading and manipulating online data.
In Chapter 9, Fractals: The Geometry of Nature, we use the
new Python match command to determine which production rule
to apply for L-systems.
We have also added a glossary of terms at the end of the text.

How to Use This Text

Chapter Organization
This text is organized into three parts. Chapters 1–5 introduce all of
the key control structures, emphasizing straightforward imperative
programming constructs such as variables, loops, and conditionals.
By the end of the first five chapters, all of the major Python data
types have been covered—including integers, floats, strings, lists,
dictionaries, tuples, and files.
In the first chapter, we introduce the idea of an object as
something you can use. In a sense, programming in Python is an
objects-always approach. Students begin by using common
programming concepts while employing the modules that Python
provides. These modules allow us to address more interesting
problems without introducing unnecessary complexity. For example,
we cover simple graphics in Chapter 1 by using a turtle graphics
module. In Chapter 6, we cover image processing through the use of
a simple image object that automatically loads an image from a file
but allows the students to get and set the values of pixels.
The next chapters contain more details about the concepts
introduced in Chapters 1–5. Chapters 6–9 provide students with an
opportunity to get more comfortable with basic programming
concepts while presenting additional problem-solving patterns.
Students also learn more about the internal mechanisms of Python.
The last chapters emphasize object-oriented programming and
introduce the concepts needed to design and build classes. When
these topics are introduced, students are comfortable with the idea
of using an object; in turn, building their own objects is a natural
next step. Our first examples emphasize the importance of
interactions between multiple real-world objects. After implementing
simple classes, we introduce inheritance in a natural way by creating
a graphics library and by implementing interactive games as an
extension of the turtle module.

Using the Text


This text can be used in several ways. Figure P.1 provides an
overview of some possibilities. One path is to move through the text
sequentially. Instructors could cover the entire text in a single
semester, or because there is enough exploratory material to last an
entire year, instructors could cover the material in two semesters. A
second path would be to cover Chapters 1–5 and then move to
Chapters 10–13. This approach provides a balance between
imperative and object-oriented programming that fits easily into a
single semester. If instructors have additional time, they can pick
and choose from Chapters 6–9 before continuing to Chapters 10–13.
Another suggestion would be to teach Chapters 1–9 in an
introductory course that covers only imperative programming and
the use of objects.
Figure P.1 Road map.

Description

Using the Exercises


This text includes three kinds of exercises. First, some Try It Out
exercises ask students to run the code that has been presented as
part of the section. With these exercises, students use the code to
learn or explore on their own. Second, other Try It Out exercises
have students modify or extend the code provided in the section.
Many times, a simple version of the code is provided, and students
are asked to modify the code to improve it or add additional
features. Third, programming exercises at the end of each chapter
describe complete projects that are related to the materials covered
in the chapter.
Throughout the text, we have included Try It Out exercises within
each section. These exercises are structured so that they can be
used in several ways:

If you are reading this text as a self-study, the Try It Out


exercises provide breaking points where you have the
opportunity to stop reading and practice the concepts.
Instructors may find that many of the exercises contain material
to cover in a lecture that complements the material the students
have read.
In a traditional lecture course, the exercises can be used as
homework problems. We have had good luck in the introductory
computer science course using many small programming
assignments. Often the students are able to do more than 30
small programming assignments during a single semester.
This text can also be used as part of a “hands-on” introduction
to computer science. A small amount of lecture can be used to
introduce the main points of a chapter, but the majority of the
class time is used to work on the exercises that complement the
reading. This approach follows a growing trend in active
learning computer science education and was well received by
our students.

Key Topics by Chapter


Table P.1 maps the problems that are introduced in each chapter
with the key computer science concepts that are established in the
chapter.

TABLE P.1 Problems and Key Concepts

Chapter Problem Key Computer Science Concepts


1. Introduction Drawing polygons and Problem-solving strategies, numeric
to Python approximating a circle data types, assignment statements,
Common problem-solving using turtle objects, simple for loops,
strategies simple functions
2. Playing by Creating a chatbot Simple string definition and searches,
the Rules Guessing a Secret Number Boolean expressions and simple
Playing the game of Nim selection statements, the accumulator
patterns, while loops, functions that
return values, user input, random
module
3. Codes and Cipher algorithms— More on the string data type and
Other Secrets transposition, substitution methods, character functions, modulo
algorithms arithmetic, keyword parameters
4. Introducing Computing simple Python list, tuple, and dictionary data
the Python statistics types; math module; statistics
Collections module; matplotlib library
5. Bigger Data: Working with data File input and output, string
File I/O formatting, reading online data in CSV
and JSON formats, reading and
manipulating data using the pandas
library, list comprehension
6. Image Digital image processing, Nested loops, passing functions as
Processing pixel manipulations, parameters, scoping rules
enlarging and reducing
Chapter Problem Key Computer Science Concepts
images, edge detection
algorithms
7. Data Mining: Cluster analysis and More on Python list and dictionary
Cluster Analysis visualization of large data data types, more on reading from files
sets
8. Cryptanalysis Methods for cracking Storing nontrivial data in lists and
transposition and dictionaries, string processing, regular
substitution ciphers, expression module
frequency analysis
9. Fractals: The What fractals are; how we Recursion, grammars, and production
Geometry of can use them to simulate rules; the Python match command
Nature trees, shrubs, snowflakes,
and other natural objects
10. Planet Calculating and plotting Introduce object-oriented design and
Objects the interaction of large construction of classes, instance
celestial bodies variables, methods
11. Simulation Simulating predator–prey Using objects in a simulation; many
relationships objects with simple behaviors can lead
to interesting complex results
12. A Hierarchy Designing an object- Inheritance, abstract classes and
of Shapes oriented graphics library abstract methods, polymorphism
with points, lines,
polygons, and other
shapes
13. Interactive Designing and Event-driven programming,
Games implementing simple inheritance, static variables, static
interactive games methods

Supplements
Instructor supplements, including answers to chapter exercises, a
test bank, and PowerPoint lecture outlines, and a sample syllabus,
are available for instructor download. Source code from listings
presented in the chapters is also provided for students and
instructors. For more information and to request access, contact
your account representative at go.jblearning.com/python4e.
Random documents with unrelated
content Scribd suggests to you:
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like