100% found this document useful (3 votes)
227 views

Building Python Programs 1st Edition Stuart Reges 2024 Scribd Download

Building

Uploaded by

slupeimpey3i
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
227 views

Building Python Programs 1st Edition Stuart Reges 2024 Scribd Download

Building

Uploaded by

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

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Building Python Programs 1st Edition Stuart Reges

https://textbookfull.com/product/building-python-
programs-1st-edition-stuart-reges/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


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

Building Java Programs: A Back to Basics Approach Stuart


Reges

https://textbookfull.com/product/building-java-programs-a-back-to-
basics-approach-stuart-reges/

textboxfull.com

Building Java Programs - A Back to Basics Approach Stuart


Reges

https://textbookfull.com/product/building-java-programs-a-back-to-
basics-approach-stuart-reges-2/

textboxfull.com

Building Java Programs: A Back to Basics Approach, 5th


Edition Stuart Reges

https://textbookfull.com/product/building-java-programs-a-back-to-
basics-approach-5th-edition-stuart-reges/

textboxfull.com

Fundamentals of Python: First Programs, 2nd Edition


Kenneth A. Lambert

https://textbookfull.com/product/fundamentals-of-python-first-
programs-2nd-edition-kenneth-a-lambert/

textboxfull.com
Building Community and Family Resilience: Research,
Policy, and Programs Mike Stout

https://textbookfull.com/product/building-community-and-family-
resilience-research-policy-and-programs-mike-stout/

textboxfull.com

Python Data Analysis: Perform data collection, data


processing, wrangling, visualization, and model building
using Python 3rd Edition Avinash Navlani
https://textbookfull.com/product/python-data-analysis-perform-data-
collection-data-processing-wrangling-visualization-and-model-building-
using-python-3rd-edition-avinash-navlani/
textboxfull.com

Choppy Water 1st Edition Stuart Woods [Woods

https://textbookfull.com/product/choppy-water-1st-edition-stuart-
woods-woods/

textboxfull.com

Dendrites 3rd Edition Greg Stuart

https://textbookfull.com/product/dendrites-3rd-edition-greg-stuart/

textboxfull.com

The New Mechanical Philosophy 1st Edition Stuart Glennan

https://textbookfull.com/product/the-new-mechanical-philosophy-1st-
edition-stuart-glennan/

textboxfull.com
Building Python Programs
First Edition

Stuart Reges
University of Washington
Marty Stepp
Stanford University
Allison Obourn
University of Arizona

330 Hudson Street, NY, NY 10013


Senior Vice President Courseware Portfolio Management:
Marcia Horton
Vice President, Portfolio Management: Engineering, Computer
Science & Global Editions: Julian Partridge
Executive Portfolio Manager: Matt Goldstein
Portfolio Management Assistant: Meghan Jacoby
Field Marketing Manager: Demetrius Hall
Product Marketing Manager: Yvonne Vannatta
Marketing Assistant: Jon Bryant
Managing Producer: Scott Disanno
Content Producer: Amanda Brands
Project Manager: Rose Kernan, RPK Editorial Services
Manufacturing Buyer, Higher Ed, Lake Side Communications,
Inc. (LSC): Maura Zaldivar-Garcia
Cover Design: Pearson CSC
R&P Manager: Ben Ferrini
Inventory Manager: Bruce Boundy
Cover Art: Matt Walford/Cultura/Getty Images
Full Service Vendor: Pearson CSC
Full-Service Project Management: Pearson CSC/Rose Kernan
Composition: Pearson CSC
Printer/Binder: LSC Communications, Inc

The authors and publisher of this book have used their best efforts
in preparing this book. These efforts include the development,
research, and testing of the theories and programs to determine
their effectiveness. The authors and publisher make no warranty of
any kind, expressed or implied, with regard to these programs or to
the documentation contained in this book. The authors and publisher
shall not be liable in any event for incidental or consequential
damages in connection with, or arising out of, the furnishing,
performance, or use of these programs.

Copyright © 2019 Pearson Education, Inc., Hoboken, New Jersey


07030. All rights reserved. Printed in the United States of America.
This publication is protected by copyright, and permission should be
obtained from the publisher prior to any prohibited reproduction,
storage in a retrieval system, or transmission in any form or by any
means, electronic, mechanical, photocopying, recording, or
otherwise. For information regarding permissions, request forms and
the appropriate contacts within the Pearson Education Global Rights
& Permissions department, please visit www.pearsonhighed.com/
permissions/.

Many of the designations by manufacturers and seller to distinguish


their products are claimed as trademarks. Where those designations
appear in this book, and the publisher was aware of a trademark
claim, the designations have been printed in initial caps or all caps.

Unless otherwise indicated herein, any third-party trademarks that


may appear in this work are the property of their respective owners
and any references to third-party trademarks, logos or other trade
dress are for demonstrative or descriptive purposes only. Such
references are not intended to imply any sponsorship, endorsement,
authorization, or promotion of Pearson’s products by the owners of
such marks, or any relationship between the owner and Pearson
Education, Inc. or its affiliates, authors, licensees or distributors.

Library of Congress Cataloging-in-Publication Data

Names: Reges, Stuart, author. | Stepp, Martin, author. | Obourn,


Allison, author.

Title: Building Python programs / Stuart Reges, University of


Washington, Marty Stepp, Stanford University, Allison Obourn,
University of Arizona.

Description: First edition. | New York, NY : Pearson, [2019] |


Includes index.

Identifiers: LCCN 2018028848| ISBN 9780135205983 | ISBN


0135205980

Subjects: LCSH: Python (Computer program language)

Classification: LCC QA76.73.P98 R445 2019 | DDC 005.13/3—dc23

LC record available at https://lccn.loc.gov/2018028848

1 18
ISBN 10: 0-13-520598-0

ISBN 13: 978-0-13-520598-3


Preface
The Python programming language has become enormously popular
in recent years. Many people are impressed with how quickly you
can learn Python’s simple and intuitive syntax and that has led many
users to create popular libraries. Python was designed by Guido van
Rossum who has been affectionaly dubbed “Benevolent Dictator For
Life (BDFL)” by the Python community. He has said that he chose
the name Python because he was “in a slightly irreverent mood” and
that he is “a big fan of Monty Python’s Flying Circus” (a British
comedy show). Who wouldn’t want to learn a programming language
named after a group of comedians?

Our new Building Python Programs text is designed for use in a first
course in computer science. We have class-tested it with hundreds
of undergraduates at the University of Arizona, most of whom were
not computer science majors. This textbook is based on our
previous text, Building Java Programs, now in its fourth edition. The
Java text has proven effective in our class testing with thousands of
students including our own at the University of Washington since
2007.

Introductory computer science courses have a long history at many


universities of being “killer” courses with high failure rates. But as
Douglas Adams says in The Hitchhiker’s Guide to the Galaxy, “Don’t
panic.” Students can master this material if they can learn it
gradually.

Python has many attributes that make it an appealing language for a


first computer science course. It has a simple and concise yet
powerful syntax that makes it pleasant to learn and great for writing
many common programs. A student can write their first Python
program with only a single line of code, as opposed to several lines
in most other languages such as Java or C++. Python includes a
built-in interpreter and read-evaluate-print loop (REPL) for quickly
running and testing code, encouraging students to test and explore
the language. Python also offers a rich set of libraries that students
can use for graphics, animation, math, scientific computing, games,
and much more. This text has been built from the start for Python 3,
the most modern version of the language as of this writing, and it
embraces the modern features and idioms of that version of the
language.

Our teaching materials are based on a “back to basics” approach


that focuses on procedural programming and program
decomposition. This is also called the “objects later” approach, as
opposed to the “objects early” approach taught in some schools. We
know from years of experience that a broad range of scientists,
engineers, and others can learn how to program in a procedural
manner. Once we have built a solid foundation of procedural
techniques, we turn to object-oriented programming. By the end of
the text, students will have learned about both styles of
programming.
The following are the key features of our approach and materials:

Focus on problem solving. Many textbooks focus on language


details when they introduce new constructs. We focus instead on
problem solving. What new problems can be solved with each
construct? What pitfalls are novices likely to encounter along the
way? What are the most common ways to use a new construct?
Emphasis on algorithmic thinking. Our procedural approach
allows us to emphasize algorithmic problem solving: breaking a
large problem into smaller problems, using pseudocode to refine
an algorithm, and grappling with the challenge of expressing a
large program algorithmically.
Thorough discussion of topics. The authors have found that
many introductory texts rapidly cover new syntax and concepts
and then quickly race on to the next topic. We feel that the
students who crack open their textbook are exactly the sort that
want more thorough and careful explanation and discussion of
tricky topics. In this text we favor longer explanations, with more
verbiage, figures, and code examples than in many other texts.
Layered approach. Programming involves many concepts that
are difficult to learn all at once. Teaching a novice to code is like
trying to build a house of cards; each new card has to be placed
carefully. If the process is rushed and you try to place too many
cards at once, the entire structure collapses. We teach new
concepts gradually, layer by layer, allowing students to expand
their understanding at a manageable pace.
Emphasis on good coding style. We show code that uses
proper and consistent programming style and design. All
complete programs shown in the text are thoroughly commented
and properly decomposed. Throughout the text we discuss
common idioms, good and bad style choices, and how to choose
elegant and appropriate ways to decompose and solve each new
category of problem.
Carefully chosen language subset. Rather than a “kitchen
sink” approach that tries to show the student every language
construct and feature, we instead go out of our way to explain
and use a core subset of the Python language that we feel is
most well suited to solving introductory level problems.
Case studies. We end most chapters with a significant case
study that shows students how to develop a complex program in
stages and how to test it as it is being developed. This structure
allows us to demonstrate each new programming construct in a
rich context that cannot be achieved with short code examples.

Layers and Dependencies


Many introductory computer science texts are language-oriented,
but the early chapters of our approach are layered. For example,
Python has many control structures (including loops and if/else

statements), and many texts include all of these control structures in


a single chapter. While that might make sense to someone who
already knows how to program, it can be overwhelming for a novice
who is learning how to program. We find that it is much more
effective to spread these control structures into different chapters so
that students learn one structure at a time rather than trying to learn
them all at once.

The following table shows how the layered approach works in the
first seven chapters:

Layers in Chapters 1 –7

Chapters 1 –5 are designed to be worked through in order, with


greater flexibility of study then beginning in Chapter 6 . Chapter
6 (File I/O) may be skipped, although the case study in Chapter
7 (Lists) involves reading from a file, a topic that is covered in
Chapter 6 .

The following figure represents a dependency chart for the book. A


strong dependency is drawn as a solid arrow; we recommend not
covering chapters outside of their strong dependency order. A weak
dependency is drawn as a dashed arrow. Weak dependencies are
ones where the later chapter briefly mentions a topic from the earlier
chapter, but the chapter can still be read and explored without
having covered the earlier chapter if necessary.
Chapter dependency chart

Here are more detailed explanations of the weak dependencies


between chapters:

A few examples from Chapter 7 on lists, and from Chapter


8 on dictionaries and sets, read data from files. File
input/output is covered in Chapter 6 . But overall file-reading is
not required in order to discuss lists or other collections, so
Chapter 6 can be skipped if desired.
A few examples from Chapter 11 on classes and objects
mention the concept of reference semantics, which is introduced
in Chapter 7 on lists. But the concept of references is re-
explained in Chapter 11 , so classes can be covered early
before lists if desired.
Some of the recursive functions in Chapter 9 process lists,
and one recursive function recursively reverses the lines of a file.
So Chapter 9 weakly depends on Chapter 7 . But almost
every recursive function written in Chapter 9 can be written
and understood using only the Chapter 1 –5 core material.

As you can see from the diagram, Chapter 7 on Lists is perhaps


the most important chapter after the first five, and its material is
used by many other chapters. A common chapter order swap would
be to cover Chapters 1 –5 , then do Chapter 7 on Lists, then
go back to Chapter 6 on Files with the extra knowledge of lists to
help you.

Supplements
Answers to all self-check problems appear on our web site and are
accessible to anyone: http://www.buildingpythonprograms.com/

In addition, our web site also has the following additional resources
available for students:

Online-only supplemental content


Source code and data files for all case studies and other
complete program examples.
The DrawingPanel class used in Chapter 3 .
Links to web-based programming practice tools.

Instructors can access the following resources from our web site:

PowerPoint slides suitable for lectures.


Solutions to exercises and programming projects, along with
homework specification documents for many projects.
Sample Exams and solution keys.

To access instructor resources, contact us at


[email protected]. For other questions
related to resources, contact the authors and/or your Pearson
representative.

MyLab Programming
MyLab Programming helps students fully grasp the logic, semantics,
and syntax of programming. Through practice exercises and
immediate, personalized feedback, MyLab Programming improves
the programming competence of beginning students, who often
struggle with the basic concepts and paradigms of popular high-level
programming languages. A self-study and homework tool, the
MyLab Programming course consists of hundreds of small practice
exercises organized around the structure of this textbook. For
students, the system automatically detects errors in the logic and
syntax of their code submissions and offers targeted hints that
enable students to figure out what went wrong—and why. For
instructors, a comprehensive gradebook tracks correct and incorrect
answers and stores the code inputted by students for review.

MyLab Programming is offered to users of this book in partnership


with Turing’s Craft, the makers of the CodeLab interactive
programming exercise system. For a full demonstration, to see
feedback from instructors and students, or to get started using
MyLab Programming in your course, visit: http://
www.pearson.com/mylab/programming.

Acknowledgments
We would also like to thank the staff at Pearson who helped produce
the book. Rose Kernan managed the project and was our primary
point of contact during book production. Rose did a phenomenal job;
she was diligent, responsive, and helpful at every step of the
process. Amanda Brands was our content producer, and she also
provided excellent support along the way. Thank you to Martha
McMaster for proofreading the text, and thanks to Shelly Gerger-
Knechtl for copy editing and indexing. We thank Yvonne Vannatta,
our marketing manager, and Meghan Jacoby, our editorial assistant.
We also want to thank the team of artists and compositors from
Pearson’s partner institutions who helped produce the chapters of
this text.

We would like to thank our lead editor at Pearson, Matt Goldstein.


Over a decade ago Matt believed in our work and partnered with us
to create the original Building Java Programs on which this text is
based. Matt has been a stalwart supporter and is always a pleasure
to work with.

Last but not least, the authors would like to thank the CSC 110
students at the University of Arizona who class-tested our chapters
in rough draft form. Students provided helpful suggestions for
improving the content and also submitted corrections for typos and
errors in drafts of chapters.

Stuart Reges
University of Washington
Marty Stepp
Stanford University
Allison Obourn
University of Arizona
MyLab Programming
Through the power of practice and immediate personalized
feedback, MyLab Programming™ helps students master
programming fundamentals and build computational thinking skills.

PROGRAMMING PRACTICE
With MyLab Programming, your students will gain first-hand
programming experience in an interactive online environment.

IMMEDIATE, PERSONALIZED
FEEDBACK
MyLab Programming automatically detects errors in the logic and
syntax of their code submission and offers trageted hints that
enables students to figure out what went wrong and why.

GRADUATED COMPLEXITY
MyLab Programming breaks down programming concepts into short,
understandable sequences of exercises. Within each sequence the
level and sophistication of the exercises increase gradually but
steadily.

DYNAMIC ROSTER
Students’ submissions are stored in a roster that indicates whether
the submission is correct, how many attempts were made, and the
actual code submissions from each attempt.
PEARSON eTEXT
The Pearson eText gives students access to their textbook anytime,
anywhere

STEP-BY-STEP VIDEONOTE
TUTORIALS
These step-by-step video tutorials enhance the programming
concepts presented in select Pearson textbooks.

For more information and titles available with MyLab Programming,


please visit www.pearson.com/mylab/programming

Copyright © 2018 Pearson Education, Inc. or its affiliate(s). All rights reserved. HELO88173 · 11/15
Brief Contents
Chapter 1 Introduction to Python Programming 1

Chapter 2 Data and Definite Loops 57

Chapter 3 Parameters and Graphics 132

Chapter 4 Conditional Execution 219

Chapter 5 Program Logic and Indefinite Loops 295

Chapter 6 File Processing 364

Chapter 7 Lists 418

Chapter 8 Dictionaries and Sets 517

Chapter 9 Recursion 563

Chapter 10 Searching and Sorting 636

Chapter 11 Classes and Objects 686

Chapter 12 Functional Programming 738

Appendix A Python Summary 785


Contents
Chapter 1 Introduction to Python Programming 1
1.1 Basic Computing Concepts 2
Why Programming? 2

Hardware and Software 3

The Digital Realm 4

The Process of Programming 6

Why Python? 7

The Python Programming Environment 8

1.2 And Now: Python 10


Printing Output 14

String Literals (Strings) 15

Escape Sequences 16

Printing a Complex Figure 18

Comments, Whitespace, and Readability 19

1.3 Program Errors 22


Syntax Errors 23

Logic Errors (Bugs) 25


1.4 Procedural Decomposition 26
Functions 27

Flow of Control 31

Identifiers and Keywords 34

Functions That Call Other Functions 36

An Example Runtime Error 38

1.5 Case Study: Drawing Figures 40


Structured Version 41

Final Version without Redundancy 42

Analysis of Flow of Execution 44

Chapter 2 Data and Definite Loops 57


2.1 Basic Data Concepts 58
Types 58

Expressions 59

Literals 62

Arithmetic Operators 62

Precedence 66

Mixing and Converting Types 69

2.2 Variables 70
A Program with Variables 74
Increment/Decrement Operators 79

Printing Multiple Values 80

2.3 The for Loop 83


Using a Loop Variable 87

Details about Ranges 90

String Multiplication and Printing Partial Lines 94

Nested for Loops 98

2.4 Managing Complexity 101


Scope 101

Pseudocode 103

Constants 108

2.5 Case Study: Hourglass Figure 111


Problem Decomposition and Pseudocode 112

Initial Structured Version 114

Adding a Constant 115

Chapter 3 Parameters and Graphics 132


3.1 Parameters 133
The Mechanics of Parameters 139

Limitations of Parameters 141


Multiple Parameters 145

Parameters versus Constants 148

Optional Parameters 149

3.2 Returning Values 151


The math Module 153

The random Module 156

Defining Functions That Return Values 160

Returning Multiple Values 165

3.3 Interactive Programs 167


Sample Interactive Program 170

3.4 Graphics 172


Introduction to DrawingPanel 173

Drawing Lines and Shapes 176

Colors 179

Drawing with Loops 183

Text and Fonts 186

Images 188

Procedural Decomposition with Graphics 189


3.5 Case Study: Projectile Trajectory 191
Unstructured Solution 195

Structured Solution 196

Graphical Version 199

Chapter 4 Conditional Execution 219


4.1 if/else Statements 220
Relational Operators 222

Nested if/else Statements 225

Factoring if/else Statements 231

Testing Multiple Conditions 232

4.2 Cumulative Algorithms 233


Cumulative Sum 233

Min/Max Loops 236

Cumulative Sum with if 239

Roundoff Errors 242

4.3 Functions with Conditional Execution 245


Preconditions and Postconditions 245

Raising Exceptions 246

Revisiting Return Values 250


Reasoning about Paths 253

4.4 Strings 255


String Methods 257

Accessing Characters by Index 260

Converting between Letters and Numbers 264

Cumulative Text Algorithms 267

4.5 Case Study: Basal Metabolic Rate 269


One-Person Unstructured Solution 270

Two-Person Unstructured Solution 273

Two-Person Structured Solution 275

Procedural Design Heuristics 280

Chapter 5 Program Logic and Indefinite Loops 295


5.1 The while Loop 296
A Loop to Find the Smallest Divisor 298

Loop Priming 300

5.2 Fencepost Algorithms 303


Fencepost with if 306

Sentinel Loops 308

Sentinel with Min/Max 310


5.3 Boolean Logic 312
Logical Operators 315

Boolean Variables and Flags 318

Predicate Functions 320

Boolean Zen 322

Short-Circuited Evaluation 325

5.4 Robust Programs 329


The try/except Statement 330

Handling User Errors 333

5.5 Assertions and Program Logic 335


Reasoning about Assertions 337

A Detailed Assertions Example 339

5.6 Case Study: Number Guessing Game 343


Initial Version without Hinting 344

Randomized Version with Hinting 346

Final Robust Version 348

Chapter 6 File Processing 364


6.1 File-Reading Basics 365
Data and Files 365

Reading a File in Python 369


Line-Based File Processing 372

Structure of Files and Consuming Input 373

Prompting for a File 378

6.2 Token-Based Processing 381


Numeric Input 383

Handling Invalid Input 385

Mixing Lines and Tokens 386

Handling Varying Numbers of Tokens 388

Complex Input Files 392

6.3 Advanced File Processing 394


Multi-Line Input Records 395

File Output 397

Reading Data from the Web 400

6.4 Case Study: ZIP Code Lookup 403

Chapter 7 Lists 418


7.1 List Basics 419
Creating Lists 420

Accessing List Elements 423

Traversing a List 429


Discovering Diverse Content Through
Random Scribd Documents
The black and nearly nude ambassadors remained in camp for a brief
time, and one of them, on seeing the practice of the Gatling gun, which sent
streams of bullets in every direction to which its muzzle was turned, told his
colleagues that 'it was vain to fight against foes so terribly armed.'

On this they taunted him with cowardice, of which they threatened to


inform King Koffee, and, knowing what his doom would be, the
unfortunate creature shot himself, and was buried on his own side of the
river, when each Ashantee, in accordance with some ancient custom, threw
a handful of dust on his body and took their departure.

It was evident that there would soon be fighting now. 'Sir Garnet's
demands were that the king must release all European prisoners' (of whom
he had several), 'pay £200,000 for the cost of the war, and sign in presence
of our forces a treaty securing firmly the British Protectorate from future
aggression. Private warnings, however, and the information gained by Lord
Gifford and Major Russel in their scouting advance beyond the Prah, caused
Sir Garnet to distrust completely all the king's overtures for peace.'

On the night after the dusky ambassadors had departed, Tony Dalton
had command of an out-piquet in the direction of the enemy, and as the
sunset passed away he had, as in duty bound, examined carefully all the
ground in his vicinity.

A night piquet, especially in a wood and in a savage country, is always a


post of danger. By day sentries can see about them more or less, but not so
in the gloom of night, and in a jungly wilderness where savages might creep
upon them unawares—even past or between them—and cut the piquet off.
Hence no man thought of sleeping, and Dalton had at least one connecting
sentry on the narrow track that led to the front where his line was posted.

The pipers of the Black Watch, playing tattoo in the hutted camp, had
made the mighty woods of the Prah re-echo to the notes of the 'Pibroch of
Donuil Dhu,' its last notes had died away in the leafy dingles, and as silence
stole over the plain Dalton gave way to thought.

The war in which he was engaged had been stigmatised as one against
savages, but they were savages who were far from being feeble foes; and if
(as a print of the time said) 'by honour and glory is meant the creditable
performance of duty at the call of the State, then is that just as applicable to
soldiers and sailors who fight savages as to those engaged in the more
showy scenes of European war. Her Majesty's troops do not pick and
choose either the enemies they have to encounter, or the regions wherein
their valour and fortitude are to be displayed; and it is unjust to shower
laurels on one set of men, while another, equally employed in defending our
empire, are deprived of due recognition.'

It was with a consciousness of this—the high sense of duty—that our


troops landed cheerfully on the perilous Gold Coast; yet Dalton, like many
of his comrades, had been elsewhere engaged in 'the big wars that make
ambition virtue,' and he felt that this Ashanti strife, though a petty one, was
fraught with many dangers peculiar to itself. Would he escape them, and yet
be spared to enjoy the society of the now brilliant and beautiful Laura and
their sweet little daughter? How hard if the bullet of a naked savage
deprived him of that double joy, and gave him a grave amid the eternal
forest that spread from the Prah to Coomassie!

He tried to shun this thought—that almost fear, which came to his


naturally gallant spirit—but failed. It would come again and again, with a
persistency that troubled him; for life seemed dearer, sweeter now, than it
had ever been before. He never thought of sleep, but indulged in waking
dreams of scenes and faces far away in pleasant Hampshire, and in hopes
that the wild work would soon be over, and hideous Coomassie won.

The night wind was whispering among rushes and reeds of wondrous
growth, or stirring the foliage of the cotton-trees, between which could be
seen the stars—constellations unknown in our northern hemisphere; and he
could hear the ripple of the Prah as it poured between its banks on its way
to St. Sebastian, the chirp of enormous insects, the twitter of brilliantly
plumaged birds, scared by the red gleams of the watch-fire. Round the latter
were the men of the picket, in their grey Ashanti uniforms and tropical
helmets, in groups, sitting or lying beside their piled rifles, the barrels of
which reflected the sheen of the flames.

As Dalton looked and listened, he felt as one in a dream, amid


surroundings so strange, and far over the seas his heart seemed to go, to
where no doubt at that hour little Netty, his daughter—his daughter, how
strangely it sounded!—was sleeping by her mother's side 'like a callow
cygnet in its nest'—Netty so recently found, one of whose existence he had
been so long ignorant.

The two tresses of hair he had got in such hot haste at Southampton
were many a time drawn forth from the breast-pocket of his Ashanti patrol-
jacket, to be tenderly unfolded, kissed, and replaced, for as yet no locket
had been procured in which to enshrine them, and such an ornament was
not likely to be procured among the reed-built wigwams of Coomassie.

Not far from him lay Jerry Wilmot, indulging in thoughts of his own—
wondering on what terms were now Bella Chevenix and haughty Lady Julia
Wilmot, his cold and heartless mother, who had seen him depart from his
father's house to face peril, disease, toil, and, it might be, death, so
callously!

Adjacent to Dalton's post was many a horrid souvenir of the hasty


retreat made across the Prah by the army of King Koffee, by torchlight, on
the night of the 29th of the preceding November, when three hundred men
perished. On the skirts of our camp—the foreshore of the Prah—their
festering corpses lay in scores, and many that were half skeletons hung
curiously and terribly from the branches of trees that arched over the
stream. In one place a dead Ashanti sat propped against the stem of a palm-
tree, with his head between his hands and his elbows on his knees; around
him lay heaps of bones, among which the turkey buzzards waddled. All
these men had perished by having failed to achieve a passage by the use of
their rope bridge.

Suddenly the sound of musketry close by, ringing out sharply upon the
air of the silent night, made the whole picket start to their feet.

'Stand to!' cried Dalton, drawing his sword. 'Unpile!' was the next order,
and the picket faced its line of sentries.
END OF THE SECOND VOLUME.

LONDON: PRINTED BY DUNCAN MACDONALD, BLENHEIM HOUSE.


*** END OF THE PROJECT GUTENBERG EBOOK MISS CHEYNE
OF ESSILMONT, VOLUME 2 (OF 3) ***

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.

Project Gutenberg™ eBooks are often created from several printed


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

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

This website includes information about Project Gutenberg™,


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

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like