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

Full Download Python Programming in Context, Fourth Edition Julie Anderson And Jon Anderson PDF DOCX

Python

Uploaded by

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

Full Download Python Programming in Context, Fourth Edition Julie Anderson And Jon Anderson PDF DOCX

Python

Uploaded by

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

Experience Seamless Full Ebook Downloads for Every Genre at textbookfull.

com

Python Programming in Context, Fourth Edition


Julie Anderson And Jon Anderson

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

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Fracture Mechanics: Fundamentals and Applications, Fourth


Edition Ted L. Anderson

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

textboxfull.com

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/
textboxfull.com

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/

textboxfull.com

Fundamentals of clinical psychopharmacology Anderson

https://textbookfull.com/product/fundamentals-of-clinical-
psychopharmacology-anderson/

textboxfull.com
The comet assay in toxicology 2nd Edition Diana Anderson

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

textboxfull.com

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/

textboxfull.com

Derrida Ethics Under Erasure Nicole Anderson

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

textboxfull.com

Introduction to Probability David F. Anderson

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

textboxfull.com

En avant!: beginning French Second Edition Anderson

https://textbookfull.com/product/en-avant-beginning-french-second-
edition-anderson/

textboxfull.com
World Headquarters
Jones & Bartlett Learning
25 Mall Road
Burlington, MA 01803
978-443-5000
[email protected]
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 [email protected].

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.
Other documents randomly have
different content
en lo concert de la vida, pujá sens casi deturarse las escalas de sa
casa, dihent á la minyona tan bon punt li obrí la porta del pis:

—No’m posi’l sopar á taula. Quan jo’l vulgui ja l’avisaré.

Seguidament entrá al seu dormitori y una volta desfeta del abrich


prengué una cadira y assentantse devant del secretaire obrí la tapa y
tragué un gros Dietari, ahont desde la mort de Mossen Jaume havia
apuntat escrupulosament tots los seus gastos ab sos corresponents
ingresos.

La noya Gil ab la vehemencia de son carácter, no’s veya ab cor de


dormir aquella nit sens sapiguer positivament, lo que sens
desmembrar son petit capital de set mil trescents duros, que li
produhían escassament sis pessetas diarias, podria estalviar dels
seus gastos en favor de las novas obligacions que plena
d’entussiasme estava decidida á imposarse.

Ella que may havia estat ambiciosa ¡cóm sentia no tenir major
fortuna pera disposar, més talent pera aplicarhi, més número de
relacions socials pera ésser útil á la nova Associació en que anava á
entrar!… Pero per més que en alas del seu desitj sentia ja bullir en sa
imaginació un sens fí de plans y de projectes, pensant que en aquells
moments lo que més la interessava, era veure ab lo que podia
comptar pera portar las seuas il·lusions al terreno de la práctica,
comensá á resseguir las planas del seu Dietari, ahont després de
diferentas combinacions numéricas y cálculs de tota mena y d’haver
passat un rigurós exámen á cada un dels reguerons per ahont
s’escorren las imprescindibles necessitats de cada dia, fent una petita
incisió á lo menos apremiant y fins lo sacrifici d’algun accessori en lo
refinament del seu bon gust, la Montserrat ab una interna satisfacció
que saborejava per la primera volta de sa vida, tragué victoriosament
las cuatre pessetas mensuals que ella cregué en conciencia, que
donada sa modestíssima posició necessitava pera esser sócia de las
Conferencias. Es clar que faltavan los extraordinaris, pero tantas
voltas en aquell dia havia sentit parlar de la miraculosa ajuda del cel
en las obras bonas, que no vacilá un moment en creure que, ja en
posició de lo més apremiant, Deu li inspiraría la manera de suplir ab
son ingeni y bona voluntat lo que no li fos possible donar en
metálich.

Una forta sensació de defalliment, li feu de sobte consultar son petit


relotge de butxaca que li marcava un quart de dotze, lo que
aixecantse de la cadira la feu anar en busca de la criada, escruixida
de l’hora que era y del modo com li havia passat la vetlla y lo dia que
acabava de transcorre.

Al arribar enfront de la porta de la cuyna, se presentá devant de sos


ulls lo mateix cuadro de la vigilia de Nadal, é instintivament
recordant á la desconsolada mare, que havia vist aquell dematí y á
duas novas familias de pobres que havia visitat aquella tarde, tot
donant una mirada á la seua casa, que may havia trobat tan hermosa,
y á la seua minyona dormint descansadament junt á uns fogons
provehits y á un ros pá de tres lliuras encetat per dos cantons, la
Montserrat pensant en l’efecte que la vigilia de Nadal li havia fet lo
mateix que en aquell moment estava mirant, exclamá ab la
vehemencia d’aquell cor que acabava de transfigurarse al seráfich
amor de la Caritat:
—¡Deu m’ho perdó!…
A las vellesas.
La casa de don Joaquim Bach havia sofert notables transformacions
desde’l jorn en que deu anys enrera hi vejerem per primera volta á
las seuas fillas, arreglant gentils y rialleras l’equipatge pera marxar á
Larrua.

Aquell bonich primer pis, sempre ben compost, sempre á punt de


rebre, ab sas cambras encortinadas, ab sas cadiras y sofás entapissats
de domás groch, de satí vermell y de satí blau, ab que s’havian
adornat las tres pessas del devant al estrenarse la casa, lo dia que hi
torném á entrar feya dos anys que las blancas cubertas de
madapolam no s’havian tret de las cadiras, ni las glassas s’havian
apartat de dessobre dels miralls, ni dels quadros que en amples y
luxosos marchs s’hi veyan pintats per en Napoleon los retratos d’en
Bach vestit de negre, ab un gruixut chalequero d’or y’l medallon
penjant, y lo de donya Francisqueta ab cos de vellut negre y un
carregat adrés d’or y brillants, que’l pintor pera més satisfacció de la
familia, havia engrandit estraordinariament de tamanyo.

Apesar d’ésser al cor del hivern, las salas estavan sens encatifar, los
balcons sense cortinatjes, las entradas sense portiers y los finestrons
fortament tancats. En lo menjador y en las duas cambras de la part
del darrera, únichs punts de la casa en que s’hi veyan senyals de vida,
també s’hi trobavan á faltar aquella pulcritut y carregament
d’adornos que tant encisava á don Joaquim. Allí hi havia posadas las
catifas de moqueta, pero’ls gerros estavan sense flors, lo piano
tancat, lo musiquero buyt de partituras; per totas aquellas salas s’hi
notava un cert ayre de tristesa, que invadia fins la cambra de las
noyas y lo quarto d’en Felip, en quals llits s’endevinava que feya
llarch temps que ningú hi havia dormit…

Los aucells joves que tanta vida y animació escampavan entorn seu,
cada hu per motius diferents havia abandonat aquell niu, ab tant dalé
fabricat.

L’ Adela, terriblement ferida al cor, en mitj dels joyosos somnis de sa


pensa de divuyt anys, ab la crudel nova de la mort del Arenas, de la
que ningú pogué tréurela d’acusarsen ab la desapietada severitat
d’un jutje, després d’un sens fí d’accidents nerviosos, caygué en un
capficament del que sols ne sortí després d’alguns mesos d’internas
lluytas, pera exposar terminantment á la seua familia, sa ferma
voluntat de ficarse monja en lo convent de Pedralbes. Don Joaquim
s’hi oposá ab totas sas forsas; la seua mare ab las llágrimas de una
pena, que ja no havia de acabárseli may més; la Teresina, ab tots los
arguments que sugeria á la seua imaginació viva de mena lo fraternal
amor que li portava. Més com passat un any vejessin, que no sols no
hi havia medi de persuadirla, sino que anava postrantse y
emmalaltintse de dia en dia, de bon ó de mal grat acabaren per
otorgarli’l consentiment.

Las satisfaccions que no li havia donat l’Adela, en Bach las obtingué


de la Teresina, la qui realisá totas sas esperansas casantse ab en
Cuberta. Més estava decretat que son goig no havia d’ésser sens
espinas, puig que als tres anys d’haverse instalat á Barcelona, en un
magnífich chalet del Ensanxe, que omplia á curull totas las luxosas
aspiracions del antich mantegayre, D. Francisco comensá á dir que
sos negocis de la Isla de Cuba, no marxavan com era del cás, é
insinuá la probable necessitat de tenir que anar personalment á
realisar la seua fortuna, com ell ja volia fer avans de casarse, y que
allavoras en Bach, temorós de que ab la mar pe’l mitj poguessen
sortir destorps al casament de la seua filla, posá tot son empenyo
pera que no hi anés.

Lo colp fort en un principi, esdevingué terrible, desconsolador, quan


se digué qu’en Cuberta desitjava emportarsen á la seua esposa, y’s
vejé que la Teresina, encara que vivament afectada davant del
sentiment de deixar á sos pares, consentia en marxar á América.

Lo gendre, atenuá la cosa ab totas las esperansas possibles: lo viatje


fora curt; lo temps precís pera realisar y posar en ordre y en bonas
mans, lo que de moment no’s pogués vendre y tornar tot seguit; cosa
d’un any, tal volta no hi arribaria.

No hi hagué donchs remey, y ab los ulls plens de llágrimas y un bon


feix d’inquietuts al cor, los pares Bach despediren al moll de
Barcelona á la seua filla Teresina y al seu espós, los qui no’s cansavan
de parlarlos de sa prompta tornada. Més al arribar á América, las
noticias vingueren plenas de dificultats pe’ls enredos esdevinguts en
negocis cinch anys abandonats á mans estranyas; lo cambi cada dia
més pujat del or; la escassetat de compradors que ho adineressin
mitjanament… en fí, que la Teresina que en lo seu país natal no havia
tingut familia, tingué allí un fill y una nena, y un altre fill, y que
passaren dos anys y tres y quatre, ab cartas sempre esperansadas ab
la promesa d’un retorn que no arribava may!…

Ab en Felip, no hi havia que comptarhi. Acostumat á la vida de París


y Londres, no’s trobava manera de tenirlo á Barcelona tres mesos
seguits. Per més que la pobra de la seua mare prenia las mellors
cuyneras y enviava á cercar plats á las fondas de més nom, en Felip
se desganava ab la cuyna barcelonina y’s posava trist, malhumorat y
exijent, fins al punt de no haverhi en la casa un menjar sense un
disgust. No hi havia medi de ferli un senzill roast-beef com lo
menjava á Londres, ni la choucroutte com li servian á París. Don
Joaquim desatinat, li proposá un sens fí de casaments, ab l’esperansa
de retenir aquell fill que semblava un estrany en sa propia casa; pero
en Felip, á cada proposició hi feya unas grossas riallas; era en los
únichs moments que semblava posarse de bon humor… hi reya molt,
pero no n’acceptava cap; y á la primera conjuntura favorable se’n
tornava al extranger. Aixís passaren dos ó tres anys; més com don
Joaquim se resistís ab ferma energía á donarli la exorbitant pensió
que’l seu fill necessitava, aquest qui estava disposat á tot, menos á fer
lo qu’ell ne deya vida de són ó de provincia, se ingeniá pera fer
comisions á Inglaterra y á Fransa, ahont los entristits pares, per la
temensa de que se’ls quedés allí definitivament, continuaren
enviantli cantitats, que si no eran com las que en Felip desitjava, ab
lo producto de lo que ell se feya, ne tenia prou pera passar la vida en
los llochs en que hi vivia á tot son pler. Lo que als vint anys havia fet
obligat pe’l seu pare, prompte li fou un gust, y més tart una costum
que acabá per serli una necessitat.
Una tarde que don Joaquim tornava d’acompanyarlo á la estació del
ferrocarril de Fransa, lo cotxero admirat de que’l senyor al arribar á
casa seua, no baixés del cotxe, obrí la portella y lo trobá ab un fort
atach de feridura. Ab l’ajuda del porter lo pujaren á brassos al seu
pis; s’anaren á cercar los millors metjes, s’aplicaren seguidament tots
los remeys. Deu no’l volgué encara, y en Bach no morí; pero’l
pronóstich científich fou de que restaria impossibilitat pera tota la
vida.

Donya Francisqueta ho escrigué immediatament á la Teresina y feu


tirar un parte al seu fill. Pero la carta hagué de quedarse encara sis
dias esperant correu pera l’Habana; y’l telégrama, s’enviá repetit als
primers hotels de Marsella, de Lyon y de París, puig en Felip havia
dit al marxar, que regularment se quedaria dos ó tres dias en cada
una d’aquestas poblacions, encara que sens deixar los la direcció de
cap; ja que no tenia costum d’escriurels fins á esser aposentat á la
fonda en que habitualment s’hostatjava á la capital de Inglaterra, ó á
la de Fransa quan hi havia de passar llarga temporada. Aixís fou
que’ls telegramas que se li van trasmetre de Barcelona, als deu dias
d’haverne sortit, los llegí junt ab duas cartas de la seua mare, en las
que li deya que’l perill de mort ja havia passat, y li donava tota mena
de noticias y detalls relatius al curs de la malaltia. En la fetxada
darrerament, donya Francisqueta li esplicava que á la fí, s’havia
pogut llevar á en Bach del llit pera assentarlo en un silló fet ab los
darrers adelantos científichs, puig encara que’l cervell funcionava bé,
la llengua estava poch menos que trabada, los brassos sense energia,
las camas inútils… La afligida esposa li comptava que se’l havia de
cuydar com á una criatura; sort de que si be las paraulas sortian
incoherents y enfarfegadas de sa boca, á mida que anava passant
temps, ella comprenia sino totas las qu’estavan més en relació ab las
necessitats de la vida. La pobra senyora termenava la seua carta
pregantli ab tota l’ánima que vingués á cuydar dels interessos de tots
y á compartir ab ella la tasca de cuydarlo.

En Felip li contestá á volta de correo, dihent que si en sa darrera


carta no hagués vist que, encara que malalt, lo seu pare estava fora
de perill, s’hauria posat tot seguit en camí, pero que una volta que de
moment aquell havia cessat, com se feya cárrech d’atendre als seus
prechs, quedantse resoltament á Barcelona, li precisava deixar
liquidats los negocis, que aixís á París com á Londres tenia entre
mans.

Donya Francisqueta s’enterá de la carta ab tota l’alegria compatible


ab las penas que la voltavan y la llegí al seu marit, tot besant entre un
somriure y un doll de llágrimas lo párrafo en que hi parlava del seu
prompte retorn. A la fí, encara que per tant trist motiu, dels seus tres
fills ne recobraria un; en Felip tornaria á casa seua de la que ja no
se’n mouria més: y una volta establert definitivament, podia ésser
que Deu li toqués lo cor pera dar gust al seu pare, que de tant temps
lo instava pera que’s casés, ab la esperansa de fixarlo á Barcelona. Ab
l’estat d’en Bach y ab lo d’ella mateixa, que ja feya temps estava
atacada de dolor reuma y ab l’amenassa constant de que’l mellor dia
se li posés al cor, era impossible que en Felip, no pensés seriament en
casarse.

Al arribar á aquest punt de las seuas refleccions, donya Francisqueta,


se sentí ab necessitat de desahogarse fent participar á en Bach del
goig de las seuas esperansas.
—Ja veurás, ja veurás; com ara’l noy se fará cárrech de la necessitat
que tením de que prenga un determini y’s casará. ¡Ell també
necessita qui’l cuydi… qui’l tregui de la vida que porta!… aquesta
darrera vegada l’he trobat magre, ullerós… ab aquestos grans y tacas
á la pell que no’l deixan… Jo ja corro als setanta; tinch massa anys, la
meua naturalesa forta, s’acaba ab lo temps y los disgustos… ¡Deu
vulla que ell ho reconega y’s casi aviat; d’altre modo als pochs dias,
aquesta casa li cauria sobre! ¡Está tant sola, tan trista! ¡Una noya
jove dona tanta animació entorn seu! Y després la esperansa dels
petits, dels nets… ¿No es veritat que aixó nos fora un gran consol? —
feu la esperansada mare, colpejant carinyosament las balbas mans
del seu marit.

En Bach, exhalá una munió de incoherentas sílabas, ab desitjos de


formar paraulas que no li eixiren; y com vejés que la seua esposa no’l
comprenia, ab un esfors, aixecá de dessobre dels genolls sas
desvalgudas mans, pera fregar repetidas voltas la punta del dit póls
ab la del dit índice.

—¡Ah! —saltá glassadament donya Francisqueta— ¿vols dir que tinga


diners? ¿qué sía rica?… ¡Ditxosos interessos! —afegí veyent ab los
signos del cap de son espós, que li havia comprés perfectament la
idea.

La Teresina, havia també escrit á volta de correu. La seua carta era


molt trista: estava desconsolada per la malaltía del seu pare, al qui
entranyablement estimava, y de la falta que regoneixia los hi feya en
aquesta tribulació: pero de moment era impossible de tot punt que
poguessin tornar. En la qüestió del negoci, cada dia’ls surtian novas
dificultats, novas complicacions… Pera més enredarho lo caixer feya
pochs dias que havia fugit als Estats Units, emportantsen una regular
cantitat… No era cosa pera ferlos anar malament; pero s’havia obert
una informació judicial… era qüestió de temps y de tenir
malhumoradissim á en Cuberta y dificultar la tornada.

Estava certa de que’l seu pare, ab son criteri per aquestas cosas, se
faria cárrech de que no es possible abandonar los interessos.

La pena d’aquesta carta, l’amortiguá lo rebren una d’en Felip, en la


que’ls donava part de sa vinguda pera últims de més. Lo calendari
marcava’l dia disset; no hi faltavan donchs més que uns tretse dias ó
tal volta menos per la seua arrivada.

Donya Francisqueta feu trasbalsar la casa; tot se tragué de lloch, tot


s’espolsá, tot se pulí y en particular la cambra d’en Felip, que la mare
no tenia may prou á gust seu. Lo llit, lo lavabo, lo secretaire, l’armari
mirall, las butacas, tot fou objecte d’un minuciós exámen. Era precís
que l’aposento fos molt bonich, que’l seu noy s’hi trobés ab
comoditat, pera que no tornés á pensar may més en anarsen per
aquestos mons de Deu, lluny dels pares, que á la seua edat y malalts,
era ben natural que tinguessen lo consol d’un fill ó un altre.

Apesar de que’n Felip, si be anunciava la seua vinguda, no’ls hi deya


lo dia ficso, donya Francisqueta envers las darrerías del mes, havia
fet anar cada dia al criat á la estació, pero com aquest tornés sempre
sol y fes dias que en Felip no hagués escrit, la mare comensava á
estar ab ánsia, quan rebé una carta del administrador del Hotel
Bristol de París, innovantlos que feya set dias que’l seu fill se trobava
malalt al llit, y com lo metje en aquell moment acabés de declarar
que lo que al principi cregué tan sols una indisposició sens
consecuencias, eran febres tifoideas, agravadas per estar lo malalt
treballat per altra malaltia infecciosa de carácter crónich, que per la
postració en que’l tenia, aumentava’l perill, se veya precisat á
escríurels que immediatament anés allí algú de la familia pera
cuydarlo y pagar los gastos; donchs d’altra manera, se veurian
obligats á portarlo á una casa de curació.

La pobra senyora quedá glassada, tant pe’l colp dolorosíssim que


rebia en son entranyable amor de mare, com per tenir que pendre lo
determini de lo que debia fer, ella, qui desde’l dia que va casarse no
havia pres per compte seu la més insignificant resolució.

Donya Francisqueta no tenia parents d’aprop y ab los de lluny, gent


de poca posició, lo seu marit no havia volgut que s’hi fes may. Aquest
tampoch ne tenia á Barcelona y ab los de fora ni’s coneixian: las
relacions socials, un colp monja l’Adela, casada la Teresina y per lo
tant acabadas las reunions y festas de la casa, no s’havian sostingut
ab la limitada intel·ligencia de donya Francisqueta, y ab son apocat
carácter, que las penas y’ls anys havian encongit més encara. Pagant
tribut á la moda del dia los Bachs havian tractat las amistats al
engrós, prodigantlas ab tanta estensió, que no’ls havia quedat lloch
pera conreuharne cap de verdadera; y de las anomenadas de
cumpliment, pocas vegadas se’n treuhen los amichs fidels, que fan
sacrificis, que prenen part en las afliccions y ab interés y rectitut se
desvetllan pera treure d’un apuro.

Donya Francisqueta girá donchs los ulls entorn seu y’s trobá sola:
pero en Bach li havia tan dit sempre que ab diners se tenia tot, que la
pobre dona ab las mans plenas de bitllets de Banch, cercava y
cercava, sens que se li acudís lo que tenia de fer pera salvar lo
conflicte que li havia caygut á sobre.

A no veure’l seu marit postrat en un silló, necessitant d’ella, més que


del ayre que respirava, son instint de mare, sense necessitat de
reflexions, l’hauria portada al costat del seu fill, ¿pero cóm deixar á
en Bach al qui ningú comprenia ni cuydava com ella? Es veritat que
hi podia enviar á algú del servey de la casa: pero á aquestos, encara
que’ls diners y la perspectiva d’un viatje á París, los esvahís la por de
la enfermetat, no pendrian determinacions de cap mena, no
demanarian consultas, no llegirian en los ulls del malalt, no li
endevinarian lo que volia y necessitava… serian gent estranya, gent
pagada, indiferenta.

La pobre senyora feta un mar de llágrimas, passá un quart d’hora y


dos y tres fent plans, fent combinacions que per irrealisables, los
refusava tan bon punt los acabava de concebir. Llegia y rellegia la
carta; mirava’l relotje que impassiblement li marcava’l temps que
perdia; y apesar seu, pensava en l’Adela, en las reixas del seu
convent; en la Teresina, en la mar que las separava; en lo seu fill
malalt, sol en una fonda, cuydat per gent estranya, patint, agonitzant
tal volta y després de tres quarts d’hora de infructuosas cavilacions,
sentí los crits incoherents, enrugallats de’n Bach que la cridava, y la
pobre mare mitj folla, com assedegat que troba la font desitjada, hi
corregué, se li posá al costat, li agafá las mans, y entre plors y
gemechs, li llegí la carta y li digué que li tragués una part d’aquell
doble suplici; que li digués lo que havia de fer…
D. Joaquim contragué un bon xich més sa boca torsada y volgué
parlar, frisós de treure á fora lo debassell de ideas que s’apilavan á sa
pensa, davant de la nova, tant dolorosa com inesperada, que acabava
de rebre; mes l’esfors de la voluntat s’estrellá al contacte de la
impotencia física, y sos ulls, únichs membres que’s movian á son
impuls, guspirejaren de aytal manera y sapigueren espressar tant
clarament l’anguniosa exaltació de sa ánima empresonada, que
donya Francisqueta sentintse refer á la vista d’aquell sufriment
major que’l seu, que á la fí podia esplayarlo á sa voluntat, digué:

—¡Asserenemnos, Bach, asserenemnos; y tal volta Deu nos inspiri lo


que havém de fer! Tu, tranquilisat, y del modo que pugas, orientam…
Encara faltan horas pera’l tren de la tarde… aném pensant… ¿Que ’t
sembla, si tu ’t quedessis ab la Quima y jo me’n hi anés ab en Joan?…
¡No t’exaltis! No ho vols… no tingas por… ¡No ’t deixaré!… Cercarém,
cercarém, entre’ls coneguts lo qui’ns sembli qui hi podria anar
¿veritat?

En Bach mogué’l cap en senyal d’afirmació, y donya Francisqueta


comensá á passar revista de tots los amichs y coneguts; pero don
Joaquím que per sa mateixa manera de sentir, judicava molt
justament de la dels altres, y que ab lo poch temps que portava de
malaltia havia pogut veure de la manera com havian anat
desapareixent las relacions de la casa, anava rodant lo cap á tots los
noms que li deya la seua muller, qui després de haver apurat tots los
que li havian vingut á la memoria, esclamá sobtadament:

—¡Ay, ja’l tinch! ¡ja’l tinch! ¡Aquest si que hi anirá! ¡En Francesch
que tinguerem d’aprenent quan los noys eran petits! Aquest que feya
tants anys que no havia estat á casa y que desde que va sapiguer que
estavas malalt, ha vingut tots los diumenges! ¡Tan honrat, tan bo!
¡Ell lo fará’l sacrifici de deixar sa casa per nosaltres y sobretot se
mirará’l noy ab interés! N’ estich certa… n’estich certa.

En Bach acabava de donar ab totas sas forsas son assentiment á las


paraulas de la seua esposa, quan la cambrera prou enterada de lo que
succehía entrá en la cambra cridant:

—Senyora ¡un parte! ¡un parte! ¡Tal volta diuhen que no hi pujin!
¡que está mellor!

Donya Francisqueta sentí un violent sotrach al cor y abalansantse á


la cambrera li arrebassá’l telégrama, esqueixá ab mans tremolosas la
fulla del paper tancat ab goma y llegí:

Monsieur Philippe Bach, mort deux heures matin: détails comptes


poste.

La pobre mare no sabia’l francés, pero tan bon punt obrí’l parte,
comprengué de sobte lo mot que deya mort; y llansant un crit,
caygué en terra, presa d’un fort accident nerviós.

En Bach ab los ulls que li saltavan del cap, sens poguer llegir lo paper
que la seua dona tenia estretament tancat en sas mans, pero
endevinant de sobres lo seu contingut, torná altra volta á sos crits
estridents, que’ls criats escoltaren ab la indiferencia de la gent
mercenaria, y als que donya Francisqueta ja no podia respondre per
haberla portada á pes de brassos á un dels llits de las salas del
devant.
De moment, los vehins ompliren la casa. Quan los coneguts
sapigueren la nova, molts hi anaren; alguns se retragueren dihent
que una volta que la senyora era al llit, esperarian que’s posés mellor;
altres deixaren tarjetas; y al poch temps aquella professó de gent
estranya que pujava la escala ab un ayre indiferent, que procurava fer
compungit en l’instant que trucava á la porta ó allargava la má á don
Joaquím pera repetirli com fetas ab un mateix patró, las paraulas
que havia dit lo company que acabava de sortir, aná aclarintse fins á
tornar á deixar en sa trista buydor, la espayosa casa del antich
mantegayre.

Donya Francisqueta tingué de quedarse al llit. Ab l’estat nerviós se li


havia barrejat lo dolor reuma, y per més que ab gran insistencia
demaná que ab lo silló de rodas li portessin en Bach al seu quarto,
com lo metje per la temensa de que se li reproduhís l’atach digué que
no ho permeteria fins á estar més forta, no hi hagué medi de que’l
servey la complagués en una cosa que’l facultatiu havia privat, y que
havia de donarlos la seua feyna, y tal vegada aumentar la excitació de
don Joaquím, ab lo que’l criat que dormia aprop seu, era segur que
no tindria un moment de repós en tota la nit.

Mes passats alguns dias, una tarde com donya Francisqueta hagués
ja menjat una mica y’s trobés bastant millorada, aprofitant una de las
moltas estonas en que la seua cambrera la deixava sola, se vestí com
pogué y tirantse l’edredon dessobre de las espatllas, tot agafantse per
las parets, arribá fins al quarto d’en Bach, qui al véurela llensá una
mena de alarit d’alegría.
Apesar de que’l metje, comprenent la seua ansietat, cada dia li havia
donat l’asseguransa de que la malaltía de la seua esposa era un
accident, tan sols agravat pe’l dolor reuma y per la estremada fredor
del hivern, aquell marit, que durant tot lo temps de son matrimoni,
s’havia acostumat á veure en la seua dona una mena de maniquí, al
qu’ell tenia la creencia de que li donava vida y acció, y que á bon
segur sis anys enrera hauria pogut desapareixer de la familia sens
que li hagués semblat que perdia cosa d’importancia; durant aquells
dias en que havia pensat que se li podia morir ó tal volta quedar en la
trista situació en que ell se trobava, la seua pena havia estat tant
fonda, que al véurela entrar en lo seu quarto, demacrada y envellida,
pero caminant per sos propis peus, li dirigí la més tendra y amorosa
mirada, que la encongida muller havia rebut del seu espós durant sa
llarga vida matrimonial. Mes la desolada mare, sens adonarse del
lloch que per tant tristos aconteixements adquiria en lo cor de’n
Bach, tan bon punt lo vegé y contemplá aquell quadro de tristesa y
soletat, avivántseli en la imaginació la persistent idea d’aquell fill,
mort lluny dels pares, assistit per gent estranya ó tal volta sense
ningú que li aixugués la suor, ni acostés á sos llavis assedegats una
sola gota de cordial, esclatá en un mar de llágrimas, més abundosas
com més s’esforsava pera contenirlas, y tambalejant arribá fins á en
Bach, li tirá’ls brassos al coll y flaquejantli las camas aná lliscant en
terra, fins á amagar sa cara banyada ab plors dessobre’ls genolls del
seu marit.

En Bach afalagá ab sas balbas mans los emblanquits cabells de sa


muller, y sentint serrárseli’l cor devant d’aquell sentiment que sa
trabada llengua no podia aconsolar, girá’ls ulls envers als vidres de
son balcó entre’ls quals se dibuixava lo boyrós espay de son jardí, que
las primeras ombras del capvespre embolcallavan ab son plomisch
mantell. Mes de sopte per entre mitg d’aquella vegetació migrada,
que esllanguidament s’estenia per dessobre dels parterres, d’aquellas
voradas de vaynillas y rosers formant manats de tronchs nuosos y
sechs, d’aquells plátanos americans que assotats pel vent gelat de las
derrerías del mes de Janer, onejavan sas llargas fullas grogas
esqueixadas en cent bossins, per entre mitj d’aquells caminals
deserts que en alguns llochs l’herba clapava, per un d’aquestos
estranys fenómenos de la imaginació, li semblá que totduna hi veya
aparéixer la enlluhernadora claror del sol de Juny, cayent de plé
dessobre del frondós jardí de son chalet de Larrua, il·luminant la
gentil silueta, bulliciosa y somrissenta de sos tres fills y la d’aquella
Montserrat, joveneta, hermosa, ab sos grossos ulls blaus que’l
miraban plens d’un sentiment dols, dols, com lo d’un ángel del cel…
Don Joaquím ab la pensa enfonzada en lo mon dels recórts, los veya
bé á tots quatre agrupats devall de las acácias del costat del surtidor,
ellas assegudas brodant ab sos telers á la falda, en Felip, apenas als
disset anys, alt, moreno, escardalench de galtas, pero fort, plé de
vida, enjogassat esfullant manats de flors dessobre’ls caps de las
noyas, que’l vent de la marinada esbullava tot ajuntant uns ab altres
los bucles de sos cabells.

Un jemech trist, adolorit, eixí penosament dels torsats llabis d’en


Bach y duas llágrimas grossas, rodonas, bullentas, lliscaren per
dessobre de la arrugada pell de sas galtas. Foren las absoltas
consagradas á sas il·lusions de pare, que’l pobre home no sabia
esplicarse com en mitg de sa opulenta posició, la sort s’havia atrevit á
trossejarlas!…
Barcelona, Maig de 1893
*** END OF THE PROJECT GUTENBERG EBOOK LA MONTSERRAT
***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it
away or re-use it under the terms of the Project Gutenberg
License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country where
you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is derived


from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is posted


with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning
of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute this


electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the Project
Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright 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.
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