Home > Store

Introduction to Computing and Programming in Python, 3rd Edition

Register your product to gain access to bonus material or receive a coupon.

Introduction to Computing and Programming in Python, 3rd Edition

Alternate Binding

  • Sorry, this book is no longer in print.
Not for Sale

About

Features

  • Relevant context (Computing for Communications) — Shows students that computing has a role in their professions and that it’s worth learning.
  • Manipulation of media — Includes implementing Photoshop-like effects, reversing/splicing sounds, creating animations, etc.
  • Use of Python — Provides a programming language that is easier to learn and use than Java or Scheme in real commercial use (e.g., Google, Industrial Light & Magic).
  • HTML — Acknowledges that students in this audience care about the Web; introduces HTML and covers writing programs that generate HTML.
  • The Web as a Data Source — Teaches how to read from files, but also discusses how to write programs to directly read Web pages and distill information from there for use in other calculations, other Web pages, etc. Examples include temperature from a weather page, stock prices from a financials page.
  • Real CS1 content — Meets the ACM/IEEE Computing Curriculum 2001 guidelines for a CS1 course, including coverage of procedural, object-oriented, and functional programming approaches, even though the book has been used most with non-CS majors.
  • Brief JavaScript introduction — Helps students recognize that they can learn a second language.
  • Full-chapter treatment of GUIs.
  • Exercises at the end of each chapter, including programming projects.
    • Many of these projects involve creative, open-ended programming for media creation (e.g., creating visual or audio collages.
    • Several encourage exploration of cross-disciplinary issues between computer science and other professions.  
  • Four types of boxed items — Includes CS Key Ideas, Common Bugs, Debugging Tips, and “Making It Work” tips on how to study and be successful at computer science.
  • List of learning objectives at the start of each chapter — Most chapters have two lists: One with the media learning objectives (e.g., “Be able to explain how a grayscale image can be created from a color image”) and computer science learning objectives (e.g., “Be able to explain the role of modularity in debugging”).

Description

  • Copyright 2013
  • Dimensions: 7" x 9-1/4"
  • Pages: 456
  • Edition: 3rd
  • Alternate Binding
  • ISBN-10: 0-13-292351-3
  • ISBN-13: 978-0-13-292351-4

Introduction to Computing and Programming in Python, 3e, uses multimedia applications to motivate introductory computer science majors or non-majors. The book's hands-on approach shows how programs can be used to build multimedia computer science applications that include sound, graphics, music, pictures, and movies. The students learn a key set of computer science tools and topics, as well as programming skills; such as how to design and use algorithms, and practical software engineering methods. The book also includes optional coverage of HCI, as well as rudimentary data structures and databases using the user-friendly Python language for implementation. Authors Guzdial and Ericson also demonstrate how to communicate compatibly through networks and do concurrent programming.

Sample Content

Table of Contents

Preface to the Third Edition xv
Preface to the Second Edition xvii
Preface to the First Edition xix
About the Authors xxv
1 INTRODUCTION 1
1 Introduction to Computer Science and Media Computation 3

1.1 What Is Computer Science About? 3
1.2 Programming Languages 6
1.3 What Computers Understand 8
1.4 Media Computation: Why Digitize Media? 11
1.5 Computer Science for Everyone 12
1.5.1 It’s About Communication 12
1.5.2 It’s About Process 12

2 Introduction to Programming 16
2.1 Programming Is About Naming 16
2.1.1 Files and Their Names 18
2.2 Programming in Python 19
2.3 Programming in JES 20
2.4 Media Computation in JES 21
2.4.1 Showing a Picture 25
2.4.2 Playing a Sound 27
2.4.3 Naming Values 28
2.5 Making a Program 31
2.5.1 Variable Recipes: Real Math-Like Functions That Take Input 34

3 Modifying Pictures Using Loops 40
3.1 How Pictures Are Encoded 41
3.2 Manipulating Pictures 46
3.2.1 Exploring Pictures 51
3.3 Changing Color Values 53
3.3.1 Using Loops in Pictures 53
3.3.2 Increasing/Decreasing Red (Green, Blue) 55
3.3.3 Testing the Program: Did That Really Work? 60
3.3.4 Changing One Color at a Time 61
3.4 Creating a Sunset 62
3.4.1 Making Sense of Functions 63
3.5 Lightening and Darkening 67
3.6 Creating a Negative 68
3.7 Converting to Grayscale 69

4 Modifying Pixels in a Range 75
4.1 Copying Pixels 75
4.1.1 Looping Across the Pixels with range 76
4.2 Mirroring a Picture 78
4.3 Copying and Transforming Pictures 86
4.3.1 Copying 86
4.3.2 Creating a Collage 94
4.3.3 General Copying 96
4.3.4 Rotation 98
4.3.5 Scaling 100

5 Picture Techniques with Selection and Combination 107
5.1 Replacing Colors: Red-Eye, Sepia Tones, and Posterizing 108
5.1.1 Reducing Red-Eye 111
5.1.2 Sepia-Toned and Posterized Pictures: Using Conditionals to Choose the Color 113
5.2 Combining Pixels: Blurring 118
5.3 Comparing Pixels: Edge Detection 119
5.4 Blending Pictures 122
5.5 Background Subtraction 125
5.6 Chromakey 127
5.7 Drawing on Images 131
5.7.1 Drawing with Drawing Commands 132
5.7.2 Vector and Bitmap Representations 133
5.8 Selecting Without Re-Testing 135
5.9 Programs as Specifying Drawing Process 136
5.9.1 Why Do We Write Programs? 139

2 SOUND 143
6 Modifying Sounds Using Loops 145

6.1 How Sound Is Encoded 145
6.1.1 The Physics of Sound 145
6.1.2 Exploring How Sounds Look 149
6.1.3 Encoding the Sound 151
6.1.4 Binary Numbers and Two’s Complement 153
6.1.5 Storing Digitized Sounds 154
6.2 Manipulating Sounds 156
6.2.1 Open Sounds and Manipulating Samples 156
6.2.2 Using the JES MediaTools 159
6.2.3 Looping 161
6.3 Changing the Volume of Sounds 161
6.3.1 Increasing Volume 161
6.3.2 Did That Really Work? 162
6.3.3 Decreasing Volume 166
6.3.4 Making Sense of Functions, in Sounds 167
6.4 Normalizing Sounds 167
6.4.1 Generating Clipping 169

7 Modifying Samples in a Range 174
7.1 Manipulating Different Sections of the Sound Differently 174
7.2 Splicing Sounds 177
7.3 General Clip and Copy 183
7.4 Reversing Sounds 186
7.5 Mirroring 187
7.6 On Functions and Scope 188

8 Making Sounds by Combining Pieces 193
8.1 Composing Sounds Through Addition 193
8.2 Blending Sounds 195
8.3 Creating an Echo 196
8.3.1 Creating Multiple Echoes 197
8.3.2 Creating Chords 198
8.4 How Sampling Keyboards Work 198
8.4.1 Sampling as an Algorithm 202
8.5 Additive Synthesis 203
8.5.1 Making SineWaves 203
8.5.2 Adding SineWaves Together 205
8.5.3 Checking Our Result 206
8.5.4 SquareWaves 207
8.5.5 TriangularWaves 210
8.6 Modern Music Synthesis 211
8.6.1 MP3 212
8.6.2 MIDI 212

9 Building Bigger Programs 216
9.1 Designing Programs Top-Down 217
9.1.1 A Top-Down Design Example 218
9.1.2 Designing the Top-Level Function 219
9.1.3 Writing the Subfunctions 221
9.2 Designing Programs Bottom-Up 225
9.2.1 An Example Bottom-Up Process 226
9.3 Testing Your Program 226
9.3.1 Testing the Edge Conditions 228
9.4 Tips on Debugging 228
9.4.1 Finding which Statement to Worry About 230
9.4.2 Seeing the Variables 230
9.4.3 Debugging the Adventure Game 232
9.5 Algorithms and Design 235
9.6 Running Programs Outside of JES 236

3 TEXT, FILES,NETWORKS,DATABASES, AND UNIMEDIA 242
10 Creating and Modifying Text 244

10.1 Text as Unimedia 244
10.2 Strings: Making and Manipulating Strings 245
10.3 Manipulating Parts of Strings 248
10.3.1 String Methods: Introducing Objects and Dot Notation 248
10.3.2 Lists: Powerful, Structured Text 251
10.3.3 Strings Have No Font 253
10.4 Files: Places to Put Your Strings and Other Stuff 254
10.4.1 Opening and Manipulating Files 255
10.4.2 Generating Form Letters 257
10.4.3 Writing Out Programs 258
10.5 The Python Standard Library 262
10.5.1 More on Import and Your Own Modules 263
10.5.2 Another Fun Module: Random 263
10.5.3 A Sampling of Python Standard Libraries 265

11 Advanced Text Techniques: Web and Information 270
11.1 Networks: Getting Our Text from the Web 270
11.2 Using Text to Shift Between Media 277
11.3 Moving Information Between Media 280
11.4 Using Lists As Structured Text for Media Representations 282
11.5 Hiding Information in a Picture 284

12 Making Text for the Web 289
12.1 HTML: The Notation of the Web 289
12.2 Writing Programs to Generate HTML 294
12.3 Databases: A Place to Store Our Text 299
12.3.1 Relational Databases 301
12.3.2 An Example Relational Database Using HashTables 302
12.3.3 Working with SQL 304
12.3.4 Using a Database to Build Web Pages 307

4 MOVIES 311
13 Creating and Modifying Movies 313

13.1 Generating Animations 314
13.2 Working with Video Source 322
13.2.1 Video Manipulating Examples 323
13.3 Building a Video Effect Bottom-Up 326

5 TOPICS IN COMPUTER SCIENCE 333
14 Speed 335

14.1 Focusing on Computer Science 335
14.2 What Makes Programs Fast? 335
14.2.1 What Computers Really Understand 336
14.2.2 Compilers and Interpreters 337
14.2.3 What Limits Computer Speed? 341
14.2.4 Does It Really Make a Difference? 343
14.2.5 Making Searching Faster 345
14.2.6 Algorithms That Never Finish or Can’t Be Written 347
14.2.7 Why Is Photoshop Faster Than JES? 349
14.3 What Makes a Computer Fast? 349
14.3.1 Clock Rates and Actual Computation 350
14.3.2 Storage: What Makes a Computer Slow? 351
14.3.3 Display 352

15 Functional Programming 355
15.1 Using Functions to Make Programming Easier 355
15.2 Functional Programming with Map and Reduce 358
15.3 Functional Programming for Media 362
15.3.1 Media Manipulation Without Changing State 363
15.4 Recursion: A Powerful Idea 364
15.4.1 Recursive Directory Traversals 369
15.4.2 Recursive Media Functions 371

16 Object-Oriented Programming 376
16.1 History of Objects 376
16.2 Working with Turtles 378
16.2.1 Classes and Objects 378
16.2.2 Sending Messages to Objects 379
16.2.3 Objects Control Their State 381
16.3 Teaching Turtles New Tricks 383
16.3.1 Overriding an Existing Turtle Method 385
16.3.2 Using Turtles for More 386
16.4 An Object-Oriented Slide Show 390
16.4.1 Making the Slide Class More Object-Oriented 393
16.5 Object-Oriented Media 395
16.6 Joe the Box 400
16.7 Why Objects? 401

APPENDIX 406
A Quick Reference to Python 406
A.1 Variables 406
A.2 Function Creation 407
A.3 Loops and Conditionals 407
A.4 Operators and Representation Functions 408
A.5 Numeric Functions 409
A.6 Sequence Operations 409
A.7 String Escapes 409
A.8 Useful String Methods 409
A.9 Files 410
A.10 Lists 410
A.11 Dictionaries, Hash Tables, or Associative Arrays 410
A.12 External Modules 410
A.13 Classes 411
A.14 Functional Methods 411
Bibliography 412
Index 415

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020