The Python Workbook: A Brief Introduction with Exercises and Solutions 2nd Edition Ben Stephenson download
The Python Workbook: A Brief Introduction with Exercises and Solutions 2nd Edition Ben Stephenson download
https://textbookfull.com/product/the-python-workbook-a-brief-
introduction-with-exercises-and-solutions-2nd-edition-ben-
stephenson/
https://textbookfull.com/product/the-python-workbook-a-brief-
introduction-with-exercises-and-solutions-2014th-edition-
stephenson-ben/
https://textbookfull.com/product/introduction-to-statistics-and-
data-analysis-with-exercises-solutions-and-applications-in-r-1st-
edition-christian-heumann/
https://textbookfull.com/product/naturalness-string-landscape-
and-multiverse-a-modern-introduction-with-exercises-arthur-
hebecker/
https://textbookfull.com/product/data-mining-with-spss-modeler-
theory-exercises-and-solutions-1st-edition-tilo-wendler/
AWS Certified Solutions Architect Study Guide 2nd
Edition Ben Piper
https://textbookfull.com/product/aws-certified-solutions-
architect-study-guide-2nd-edition-ben-piper/
https://textbookfull.com/product/a-brief-introduction-to-
dispersion-relations-with-modern-applications-jose-antonio-oller/
https://textbookfull.com/product/sociology-a-brief-introduction-
richard-t-schaefer/
https://textbookfull.com/product/programming-for-computations-
python-a-gentle-introduction-to-numerical-simulations-with-
python-3-6-svein-linge/
https://textbookfull.com/product/a-brief-introduction-to-the-new-
testament-bart-d-ehrman/
Texts in Computer Science
Ben Stephenson
The Python
Workbook
A Brief Introduction with Exercises
and Solutions
Second Edition
Texts in Computer Science
Series Editors
David Gries, Department of Computer Science, Cornell University, Ithaca, NY,
USA
Orit Hazzan, Faculty of Education in Technology and Science, Technion—Israel
Institute of Technology, Haifa, Israel
More information about this series at http://www.springer.com/series/3191
Ben Stephenson
123
Ben Stephenson
Department of Computer Science
University of Calgary
Calgary, AB, Canada
This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
To my wife, Flora, for 16 fantastic years of
marriage, and many more to come. To my
sons, Jonathan and Andrew, who were both
in a hurry to enter the world. I love you all.
Preface
I believe that computer programming is a skill that is best learned through hands-on
experience. While it is valuable for you to read about programming in textbooks
and watch teachers create programs at the front of classrooms, it is even more
important for you to spend time-solving problems that allow you to put program-
ming concepts into practice. With this in mind, the majority of the pages in this
book are dedicated to exercises and their solutions while only a few pages are used
to briefly introduce the concepts needed to complete them.
This book contains 186 exercises that span a variety of academic disciplines and
everyday situations. They can be solved using only the material covered in most
introductory Python programming courses. Each exercise that you complete will
strengthen your understanding of the Python programming language and enhance
your ability to tackle subsequent programming challenges. I also hope that the
connections that these exercises make to other academic disciplines and everyday
life will maintain your interest as you complete them.
Solutions to approximately half of the exercises are provided in the second half
of this book. Most of the solutions include brief annotations that explain the
technique used to solve the problem or highlight a specific point of Python syntax.
You will find these annotations in shaded boxes, making it easy to distinguish them
from the solution itself.
I hope that you will take the time to compare each of your solutions with mine,
even when you arrive at your solution without encountering any problems. Per-
forming this comparison may reveal a flaw in your program, or help you become
more familiar with a technique that you could have used to solve the problem more
easily. In some cases, it could also reveal that you have discovered a faster or easier
way to solve the problem than I have. If you become stuck on an exercise, a quick
peek at my solution may help you work through your problem and continue to
make progress without requiring assistance from someone else. Finally, the solu-
tions that I have provided demonstrate good programming style, including appro-
priate comments, meaningful variable names, and minimal use of magic numbers.
I encourage you to use good programming style when creating your solutions so
that they compute the correct result while also being clear, easy to understand, and
amenable to being updated in the future.
vii
viii Preface
Exercises that include a solution are clearly marked with (Solved) next to the
exercise name. The length of the sample solution is also stated for every exercise in
this book. While you shouldn’t expect your solution length to match the sample
solution length exactly, I hope that providing this information will prevent you from
going too far astray before seeking assistance.
This book can be used in a variety of ways. Its concise introductions to major
Python programming concepts, which are new in this edition, allow it to be used as
the lone textbook for an introductory programming course. It can also be used to
supplement another textbook that has a limited selection of exercises. A motivated
individual could teach themselves to program in Python using only this book,
though there are, perhaps, easier ways to learn the language because the concise
introductions to each topic cover only their most important aspects, without
examining every special case or unusual circumstance. No matter what other
resources you use with this book, if any, reading the chapters, completing the
exercises, and studying the provided solutions will enhance your programming
ability.
Acknowledgements
I would like to thank Dr. Tom Jenkyns for reviewing this book as it was being
created. His helpful comments and suggestions resulted in numerous refinements
and corrections that improved the quality of this work.
Part I Exercises
1 Introduction to Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 Storing and Manipulating Values . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Calling Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4 Formatting Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.5 Working with Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2 Decision Making . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.1 If Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.2 If-Else Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.3 If-Elif-Else Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.4 If-Elif Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.5 Nested If Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.6 Boolean Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3 Repetition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.1 While Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.2 For Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.3 Nested Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4.1 Functions with Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4.2 Variables in Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4.3 Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.4 Importing Functions into Other Programs . . . . . . . . . . . . . . . . . . 65
4.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
5 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
5.1 Accessing Individual Elements . . . . . . . . . . . . . . . . . . . . . . . . . 75
5.2 Loops and Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
ix
x Contents
Part II Solutions
9 Solutions to the Introduction to Programming Exercises . . . . . . . . 143
10 Solutions to the Decision Making Exercises . . . . . . . . . . . . . . . . . . 151
11 Solutions to the Repetition Exercises . . . . . . . . . . . . . . . . . . . . . . . . 161
12 Solutions to the Function Exercises . . . . . . . . . . . . . . . . . . . . . . . . . 169
13 Solutions to the List Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
14 Solutions to the Dictionary Exercises . . . . . . . . . . . . . . . . . . . . . . . 193
15 Solutions to the File and Exception Exercises . . . . . . . . . . . . . . . . . 199
16 Solutions to the Recursion Exercises . . . . . . . . . . . . . . . . . . . . . . . . 209
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Part I
Exercises
Introduction to Programming
1
Computers help us perform many different tasks. They allow us to read the news,
watch videos, play games, write books, purchase goods and services, perform com-
plex mathematical analyses, communicate with friends and family, and so much
more. All of these tasks require the user to provide input, such as clicking on a video
to watch, or typing the sentences that should be included in a book. In response, the
computer generates output, such as printing a book, playing sounds, or displaying
text and images on the screen.
Consider the examples in the previous paragraph. How did the computer know
what input to request? How did it know what actions to take in response to the input?
How did it know what output to generate, and in what form it should be presented?
The answer to all of these questions is “a person gave the computer instructions and
the computer carried them out”.
An algorithm is a finite sequence of effective steps that solve a problem. A step is
effective if it is unambiguous and possible to perform. The number of steps must be
finite (rather than infinite) so that all of the steps can be completed. Recipes, assembly
instructions for furniture or toys, and the steps needed to open a combination lock
are examples of algorithms that we encounter in everyday life.
The form in which an algorithm is presented is flexible and can be tailored to
the problem that the algorithm solves. Words, numbers, lines, arrows, pictures and
other symbols can all be used to convey the steps that must be performed. While the
forms that algorithms take vary, all algorithms describe steps that can be followed to
complete a task successfully.
A computer program is a sequence of instructions that control the behaviour of
a computer. The instructions tell the computer when to perform tasks like reading
input and displaying results, and how to transform and manipulate values to achieve a
desired outcome. An algorithm must be translated into a computer program before a
computer can be used to solve a problem. The translation process is called program-
ming and the person who performs the translation is referred to as a programmer.
1 Variable
names are case sensitive. As a result, count, Count and COUNT are distinct variable
names, despite their similarity.
1.1 Storing and Manipulating Values 5
Python respects the usual order of operations rules for mathematical operators. Since
x is 5 (from the previous assignment statement) and exponentiation has higher prece-
dence than addition, the expression to the right of the assignment operator evaluates
to 26. Then this value is stored in y.
The same variable can appear on both sides of an assignment operator. For
example:
y = y - 6
While your initial reaction might be that such a statement is unreasonable, it is, in
fact, a valid Python statement that is evaluated just like the assignment statements
we examined previously. Specifically, the expression to the right of the assignment
operator is evaluated and then the result is stored into the variable to the left of
the assignment operator. In this particular case y is 26 when the statement starts
executing, so 6 is subtracted from y resulting in 20. Then 20 is stored into y, replacing
the 26 that was stored there previously. Subsequent uses of y will evaluate to the
newly stored value of 20 (until it is changed with another assignment statement).
There are some tasks that many programs have to perform such as reading input
values from the keyboard, sorting a list, and computing the square root of a number.
Python provides functions that perform these common tasks, as well as many others.
The programs that we create will call these functions so that we don’t have to solve
these problems ourselves.
A function is called by using its name, followed by parentheses. Many functions
require values when they are called, such as a list of names to sort or the number for
which the square root will be computed. These values, called arguments, are placed
inside the parentheses when the function is called. When a function call has multiple
arguments they are separated by commas.
Many functions compute a result. This result can be stored in a variable using an
assignment statement. The name of the variable appears to the left of the assignment
operator and the function call appears to the right of the assignment operator. For
example, the following assignment statement calls the round function, which rounds
a number to the closest integer.
r = round(q)
The variable q (which must have been assigned a value previously) is passed as an
argument to the round function. When the round function executes it identifies
the integer that is closest to q and returns it. Then the returned integer is stored in r.
6 1 Introduction to Programming
Python programs can read input from the keyboard by calling the input function.
This function causes the program to stop and wait for the user to type something.
When the user presses the enter key the characters typed by the user are returned
by the input function. Then the program continues executing. Input values are
normally stored in a variable using an assignment statement so that they can be used
later in the program. For example, the following statement reads a value typed by
the user and stores it in a variable named a.
a = input()
The input function always returns a string, which is computer science terminol-
ogy for a sequence of characters. If the value being read is a person’s name, the title
of a book, or the name of a street, then storing the value as a string is appropriate.
But if the value is numeric, such as an age, a temperature, or the cost of a meal at a
restaurant, then the string entered by the user is normally converted to a number. The
programmer must decide whether the result of the conversion should be an integer
or a floating-point number (a number that can include digits to the right of the deci-
mal point). Conversion to an integer is performed by calling the int function while
conversion to a floating-point number is performed by calling the float function.
It is common to call the int and float functions in the same assignment state-
ment that reads an input value from the user. For example, the following statements
read a customer’s name, the quantity of an item that they would like to purchase, and
the item’s price. Each of these values is stored in its own variable with an assignment
statement. The name is stored as a string, the quantity is stored as an integer, and the
price is stored as a floating-point number.
name = input("Enter your name: ")
quantity = int(input("How many items? "))
price = float(input("Cost per item? "))
Notice that an argument was provided to the input function each time it was
called. This argument, which is optional, is a prompt that tells the user what to enter.
The prompt must be string. It is enclosed in double quotes so that Python knows to
treat the characters as a string instead of interpreting them as the names of functions
or variables.
Mathematical calculations can be performed on both integers and floating-point
numbers. For example, another variable can be created that holds the total cost of
the items with the following assignment statement:
total = quantity * price
This statement will only execute successfully if quantity and price have been
converted to numbers using the int and float functions described previously.
Attempting to multiply these values without converting them to numbers will cause
your Python program to crash.
1.2 Calling Functions 7
Text output is generated using the print function. It can be called with one argu-
ment, which is the value that will be displayed. For example, the following statements
print the number 1, the string Hello!, and whatever is currently stored in the vari-
able x. The value in x could be an integer, a floating-point number, a string, or a
value of some other type that we have not yet discussed. Each item is displayed on
its own line.
print(1)
print("Hello!")
print(x)
Multiple values can be printed with one function call by providing several argu-
ments to the print function. The additional arguments are separated by commas.
For example:
print("When x is", x, "the value of y is", y)
All of these values are printed on the same line. The arguments that are enclosed in
double quotes are strings that are displayed exactly as typed. The other arguments
are variables. When a variable is printed, Python displays the value that is currently
stored in it. A space is automatically included between each item when multiple
items are printed.
The arguments to a function call can be values and variables, as shown previously.
They can also be arbitrarily complex expressions involving parentheses, mathemat-
ical operators and other function calls. Consider the following statement:
print("The product of", x, "and", y, "is", x * y)
When it executes, the product, x * y, is computed and then displayed along with
all of the other arguments to the print function.
Some functions, like input and print are used in many programs while others are
not used as broadly. The most commonly used functions are available in all programs,
while other less commonly used functions are stored in modules that the programmer
can import when they are needed. For example, additional mathematical functions
are located in the math module. It can be imported by including the following
statement at the beginning of your program:
import math
Functions in the math module include sqrt, ceil and sin, among many
others. A function imported from a module is called by using the module name,
8 1 Introduction to Programming
followed by a period, followed by the name of the function and its arguments. For
example, the following statement computes the square root of y (which must have
been initialized previously) and stores the result in z by calling the math module’s
sqrt function.
z = math.sqrt(y)
Other commonly used Python modules include random, time and sys, among
others. More information about all of these modules can be found online.
1.3 Comments
Comments give programmers the opportunity to explain what, how or why they
are doing something in their program. This information can be very helpful when
returning to a project after being away from it for a period of time, or when working
on a program that was initially created by someone else. The computer ignores all
of the comments in the program. They are only included to benefit people.
In Python, the beginning of a comment is denoted by the # character. The comment
continues from the # character to the end of the line. A comment can occupy an entire
line, or just part of it, with the comment appearing to the right of a Python statement.
Python files commonly begin with a comment that briefly describes the program’s
purpose. This allows anyone looking at the file to quickly determine what the program
does without carefully examining its code. Commenting your code also makes it
much easier to identify which lines perform each of the tasks needed to compute the
program’s results. You are strongly encouraged to write thorough comments when
completing all of the exercises in this book.
2 Python provides several different mechanisms for formatting strings including the formatting
operator, the format function and format method, template strings and, most recently, f-strings.
We will use the formatting operator for all of the examples and exercises in this book but the other
techniques can also be used to achieve the same results.
10 1 Introduction to Programming
Several additional formatting examples are shown in the following table. The
variables x, y and z have previously been assigned 12, -2.75 and "Andrew"
respectively.
Like numbers, strings can be manipulated with operators and passed to functions.
Operations that are commonly performed on strings include concatenating two
strings, computing the length of a string, and extracting individual characters from
a string. These common operations are described in the remainder of this section.
Information about other string operations can be found online.
Strings can be concatenated using the + operator. The string to the right of the
operator is appended to the string to the left of the operator to form the new string.
For example, the following program reads two strings from the user which are a
person’s first and last names. It then uses string concatenation to construct a new
string which is the person’s last name, followed by a comma and a space, followed
by the person’s first name. Then the result of the concatenation is displayed.
# Extract the first character from each string and concatenate them
initials = first[0] + middle[0] + last[0]
1.6 Exercises
The exercises in this chapter will allow you to put the concepts discussed previously
into practice. While the tasks that they ask you to complete are generally small,
solving these exercises is an important step toward the creation of larger programs
that solve more interesting problems.
Exercise 2: Hello
(9 Lines)
Write a program that asks the user to enter his or her name. The program should
respond with a message that says hello to the user, using his or her name.
(n)(n + 1)
sum =
2
14 1 Introduction to Programming
Hint: You will probably find the log10 function in the math module helpful
for computing the second last item in the list.
The value 6371.01 in the previous equation wasn’t selected at random. It is the
average radius of the Earth in kilometers.
Create a program that allows the user to enter the latitude and longitude of two
points on the Earth in degrees. Your program should display the distance between
the points, following the surface of the earth, in kilometers.
Hint: The area of a circle is computed using the formula area = πr 2 . The
volume of a sphere is computed using the formula volume = 43 πr 3 .
Hint: The specific heat capacity of water is 4.186 g◦JC . Because water has a
density of 1.0 grams per milliliter, you can use grams and milliliters inter-
changeably in this exercise.
Extend your program so that it also computes the cost of heating the water. Elec-
tricity is normally billed using units of kilowatt hours rather than Joules. In this
exercise, you should assume that electricity costs 8.9 cents per kilowatt hour. Use
your program to compute the cost of boiling the water needed for a cup of coffee.
Hint: You will need to look up the factor for converting between Joules and
kilowatt hours to complete the last part of this exercise.
PV = nRT
Write a program that computes the amount of gas in moles when the user supplies
the pressure, volume and temperature. Test your program by determining the number
of moles of gas in a SCUBA tank. A typical SCUBA tank holds 12 liters of gas at
a pressure of 20,000,000 Pascals (approximately 3,000 PSI). Room temperature is
approximately 20 degrees Celsius or 68 degrees Fahrenheit.
b×h
area =
2
Write a program that allows the user to enter values for b and h. The program should
then compute and display the area of a triangle with base length b and height h.
Develop a program that reads the lengths of the sides of a triangle from the user and
displays its area.
n × s2
area = π
4 × tan
n
Write a program that reads s and n from the user and then displays the area of a
regular polygon constructed from these values.
March 22 and April 25. The month and day for Easter can be computed for a given
year using the Anonymous Gregorian Computus algorithm, which is shown below.
Set a equal to the remainder when year is divided by 19
Set b equal to the floor of year divided by 100
Set c equal to the remainder when year is divided by 100
Set d equal to the floor of b divided by 4
Set e equal to the remainder when b is divided by 4
b+8
Set f equal to the floor of
25
b− f +1
Set g equal to the floor of
3
Set h equal to the remainder when 19a + b − d − g + 15 is divided by 30
Set i equal to the floor of c divided by 4
Set k equal to the remainder when c is divided by 4
Set l equal to the remainder when 32 + 2e + 2i − h − k is divided by 7
a + 11h + 22l
Set m equal to the floor of
451
h + l − 7m + 114
Set month equal to the floor of
31
Set day equal to one plus the remainder when h + l − 7m + 114 is divided
by 31
weight
BMI = × 703
height × height
If you read the height in meters and the weight in kilograms then body mass index
is computed using this slightly simpler formula:
weight
BMI =
height × height
Discovering Diverse Content Through
Random Scribd Documents
"And see the rivers how they run
Through woods and meads, in shade and sun,
Sometimes swift, sometimes slow,—
Wave succeeding wave, they go
A various journey to the deep,
Like human life to endless sleep!"
TRENTON FALLS.
In the hills north of Utica, the West Canada Creek cuts its
remarkable gorge at Trenton Falls. It is a vigorous stream, rising in
the western slopes of the Adirondacks and flowing to the Mohawk.
In getting down through the limestone rocks from the highlands to
the plain adjacent to the river, it passes into the ravine, giving a
magnificent display of chasms, cascades and rapids, in a gorge of
such amazing construction that it is regarded as a wonder second
only to Niagara. During the ages, the torrent has cut through over
four hundred layers of the stratified limestone, exposing the
geological formation to full view, with the fossil organic remains
deposited there as the world was built. In descending the ravine,
there are five prominent cataracts, besides rapids, all compressed
within two miles distance, the aggregate descent being three
hundred and twelve feet. This wonderful gorge was the Indian Kauy-
a-hoo-ra, or the "Leaping Water," and from its color they called the
stream Kahnata, the "amber water," a name readily corrupted into
Canada Creek. The Dutch called the place after the Grand Pensioner
of Holland, Oldenbarneveld, he having sent out the first colonists
under a grant known as the "Holland Patent." It was in this region
Grover Cleveland spent his early life. A grandson of Roger Sherman,
who had charge of the Unitarian church here, is regarded as the
discoverer of the ravine in 1805, and he did much to make it known
to the world. His grave is within sound of the Sherman Fall.
Entering the chasm at the lower end, where the stream passes out
from the rock terrace to the plain, the ravine is found to be about
one hundred feet deep, the almost perpendicular rocky walls built up
in level layers as if by hands, the well-defined separate strata being
from one inch to a foot in thickness, and narrowest at the bottom.
Hemlocks and cedars crown the blackened rocks, their branches
hanging over the abyss, while far below, the boisterous torrent
rushes across the pavement of broad flagstones forming its bed.
Descending to the bottom, the impression is like being in a deep
vault, this subterranean world disclosing operations lasting through
ages, during which the rocks have slowly yielded to the resistless
power of the water and frost that has gradually cut the chasm.
Fossils and petrifactions found in the deepest strata are trod upon,
and each thin layer of the walls, one imposed upon the other, shows
the deposit of a supervening flood happening successively, yet
eternity only knows how long ago. And ages afterwards the torrent
came, and during more successive ages carved out the gorge, until it
has penetrated to the bottom of the limestone.
The torrent flows briskly out of the long and narrow vault, while
some distance above is the lowest of the series of cataracts—the
Sherman Fall—where the water plunges over a parapet of rock forty
feet high into a huge basin it has worked out. The amber-colored
waters boil furiously in this cauldron. Above the Sherman Fall the
stream flows through rapids, the chasm broadening and the lofty
walls rising higher as the hill-tops are more elevated, mounting to
two hundred feet above the torrent at a lofty point called the
Pinnacle. The floor of the ravine is level, and becomes quite wide,
with massive slabs, weighing tons, resting upon it, showing the
power of freshets which bring them down from above, and will
ultimately carry them completely through the gorge to its outlet, so
resistless is the sweep of the raging flood at such times, when every
bound these huge stones make over the rocky floor causes the
neighboring hills to vibrate, the stifled thunder of their progress
being heard above the roar of waters. At the head of this widened
gorge is the High Falls, in a grand amphitheatre, the cataract broken
into parts and combining all the varieties of cascade and waterfall,
being one hundred feet high, and the walls of the chasm rising
eighty feet higher to the surface of the land above, which keeps on
rising as the ends of the limestone strata are surmounted. The top
of this High Fall is another perpendicular wall stretching diagonally
across the chasm, and below it the protruding layers of rock form a
sort of huge stairway. Down this the waters fall in varying fashion,
finally condensing as a mass of whirling, shifting foam into a dark
pool beneath. This splendid cataract is fringed about with
evergreens and shrubbery, for between the dark thin slabs of
limestone are inserted thinner strata of crumbling shale, and these
give root-hold to the cedars and other nodding branches clinging to
the walls of the ravine. The waterfall begins at the top with the color
of melted topaz, and is unlike anything elsewhere seen, for the
hemlocks and spruces of the mountain regions impart the amber
hue to the torrent. Descending, the changing tints become steadily
lighter, until the brown turns to a creamy white, which is finally lost
under the cloud of spray at the foot of the lower stairway slide, while
beyond, the water rushes away black in hue and driving forward
almost as if shot from a cannon.
Above is another great amphitheatre, floored with rocky layers, upon
which the stream flows in gentler course. In this is the Milldam Fall,
a ledge about fourteen feet high, over which the waters make a
uniform flow all across the ravine. This has above it an expanded
platform of level slabs almost a hundred feet wide, fringed on each
side with cedars, the attractive place being called the Alhambra. At
the upper end a naked rock protrudes about sixty feet high, from
which a stream falls as a perpetual shower-bath. The creek rushes
down another complex stairway in the Alhambra Cascade. The
ravine above suddenly contracts, and the walls beyond change their
forms into shapes of curves and projections. Another cascade of
whirling, foaming waters is passed, and a new amphitheatre
entered, where great slabs of rock have fallen from the walls and lie
on the floor, ready to be driven down the ravine by freshets. The
torrent here develops another curious formation, known as the
Rocky Heart. Curved holes are being rounded out by whirling
boulders of granite, which are kept constantly revolving by the
running water, and thus readily act upon the softer limestones. The
chasm goes still farther up to the Prospect Falls, a cataract twenty
feet high, near the beginning of the ravine.
Canada Creek passes out of the lower end of the gorge, where the
limestone layers are exhausted, and their edges fall off in terraces
sharply to the lower level, and almost down to the surface of the
stream. All about the broadened channel, as it flows away towards
the Mohawk, lie the huge slabs and boulders driven down through
the chasm by repeated freshets, with the amber waters foaming
among them. This wonderful ravine is a geological mine, disclosing
the transition rocks, the first containing fossil organic remains. In the
lower part of the chasm they are compact carbonate of lime,
extremely hard and brittle, and a dark blue, almost black, in color. At
the High Fall, and above to the Rocky Heart, the upper strata are
from twelve to eighteen inches thick, and composed of the
crystallized fragments of the vertebræ of crinoidea and the shells of
terebratulæ. These fossils of the Silurian period are numerous. The
strata throughout the chasm are remarkably horizontal, varying, as
they ascend, from one inch to eighteen inches in thickness. They are
very distinct, and separated by a fine shaly substance which
disintegrates upon exposure to the air or moisture. From the top to
the bottom of the ravine small cracks extend down perpendicularly,
and run in a straight line through the whole mass across the stream.
These divide the pavements into rhomboidal slabs. The most
interesting fossils are found, among them the large trilobite, a
crustacean that could both swim and crawl upon the bottom of the
sea. This extraordinary place is in reality a Titanic fissure, cracked
through the crust of mother earth, down which roars and dashes a
tremendous torrent.
Watkins Glen, carved out of the western wall of the valley just at the
head of Seneca Lake, is constructed upon a grander scale, yet
entirely different. The torrent has hewn it among similarly laminated
rocks, but the erosive processes have made vast amphitheatres,
their great size dwarfing the diminutive brook flowing like a thread
at the bottom. The entrance, level with the floor of the valley,
presents the same squared and angular features as Havana Glen,
but inside it is a grand amphitheatre enclosed within perpendicular
stone walls three hundred feet high, and is proportionately spacious.
It is quickly seen, however, that within the grand hall the rocky
layers, instead of being squared and angular, have been smoothed
and rounded by the waters, the small but dashing stream flowing
over the floor by graceful curves through circular pools and winding
channels. This glen is built on a prodigious scale, being over three
miles long, and its head rising eight hundred feet above the valley. A
narrow cascade eighty feet high falls at the far end of the entrance
amphitheatre, and climbing up, the visitor enters "Glen Alpha," the
first of the vast chambers. There are successive glens and caverns
as one proceeds onward and upward through the "Cavern Gorge"
and "Glen Obscura," where a hotel and chalet are perched on the
rocky ledges at four hundred feet elevation. Above is the "Sylvan
Gorge," and then the fissure broadens out into its grandest section,
the "Glen Cathedral," a magnificent nave, with walls rising nearly
three hundred feet, the rocky layers giving it a level stone floor. It
has the "Pulpit Rock" and "Baptismal Font," and climbing out one
hundred and seventy feet upward alongside a cascade, the visitor
then goes onward past more grottoes, falls and gorges for a long
distance, until the "Glen Omega" is reached at the top. Here an airy
railway bridge of one of the Vanderbilt roads spans it at two hundred
feet height above the floor.
The shores of Seneca Lake, as one progresses northward, present
various pretty little glens cut deeply into the bordering hills, and as
these become lower there are vineyards and pastures displayed.
Gradually the bluffs disappear, giving place to extensive farm lands
as the level plain at the outlet is reached. Here, in imitation of a
noble Swiss example, the town of Geneva has been built at the foot
of the lake, its chief street extending along the western bank, with
villas peeping out from the foliage. This is a prominent nursery town,
florists and seedsmen being its chief merchants, and a large part of
the adjacent country being devoted to seed-growing and
propagation. Hobart College, a leading Episcopal foundation, is at
Geneva. The outlet of the lake is the Seneca River, having an
attractive waterfall, and after gathering the outflow of this group of
Central New York lakes, it goes away northeastward to Oswego
River.
NIAGARA.
The Indians who first looked upon the world's greatest cataract gave
the best idea of it in their appropriate name, "The Thunder of
Waters." There is no setting provided for it in the charms of natural
scenery; it has no outside attractions. All its beauty and sublimity are
within the rocky walls of its stupendous chasm. The approaches
from every direction are dull and tedious, the surrounding country
being flat. The forests are sparse and there are few fine trees, these
being confined to the verge of the abyss, and being generally of
recent planting. The Niagara River flows northward from Lake Erie
through a plain. The Lake Erie level is five hundred and sixty-four
feet above the sea, and in its tortuous course of about thirty-six
miles to Lake Ontario, the Niagara River descends three hundred and
thirty-three feet, leaving the level of Ontario still two hundred and
thirty-one feet above the sea. More than half of all the fresh water
on the entire globe—the whole enormous volume from the vast lake
region of North America, draining a territory equalling the entire
continent of Europe, pours through this contracted channel out of
Lake Erie. There is a swift current for a couple of miles, but
afterwards the speed is gentler as the channel broadens, and Grand
Island divides it. Then it reunites into a wider stream, flowing
sluggishly westward, small islands dotting the surface. About fifteen
miles from Lake Erie the river narrows and the rapids begin. They
flow with great speed for a mile above the falls, in this distance
descending fifty-two feet, Goat Island dividing their channel at the
brink of the cataract, where the river makes a bend from the west
back to the north. This island separates the waters, although nine-
tenths go over the Canadian fall, which the abrupt bend curves into
horseshoe form. This fall is about one hundred and fifty-eight feet
high, the height of the smaller fall on the American side being one
hundred and sixty-four feet. The two cataracts spread out to forty-
seven hundred and fifty feet breadth, the steep wooded bank of
Goat Island, separating them, occupying about one-fourth the
distance. The American fall is about eleven hundred feet wide and
the Canadian fall twice that width, the actual line of the descending
waters on the latter being much larger than the breadth of the river
because of its curving form. Recent changes, caused by falling rock
in the apex of this fall, have, however, made it a more symmetrical
horseshoe than had been the case for years. The Niagara River, just
below the cataract, contracts to about one thousand feet, widening
to twelve hundred and fifty feet beneath the new single-arch steel
bridge recently constructed a short distance farther down. For seven
miles the gorge is carved out, the river banks on both sides rising to
the top level of the falls, and the bottom sinking deeper and deeper
as the lower rapids descend towards Lewiston, and in some places
contracting to very narrow limits. Two miles below the cataract the
river is compressed within eight hundred feet, and a mile farther
down, at the outlet of the Whirlpool, where a sharp right-angled turn
is made, the enormous current is contracted within a space of less
than two hundred and fifty feet. In the seven miles distance, these
lower rapids descend about one hundred and four feet, and then
with placid current the Niagara River flows a few miles farther
northward to Lake Ontario.
The view of Niagara is impressive alike upon sight and hearing, and
this impressiveness grows upon the visitor. From the bridge just
below the American fall, and from the Canadian side, the whole
grand scene is in full display, and quickly convinces that no
description can exaggerate Niagara. The Indians first told of the
falls, and they are indicated on Champlain's map of 1632. In 1648
the Jesuit missionary Rugueneau wrote of them as a "cataract of
frightful height." The first white man who saw them was Father
Louis Hennepin, the Franciscan, in 1678, who described them as "a
vast and prodigious cadence of water which falls down after a
surprising and astonishing manner, insomuch that the universe does
not afford its parallel. The waters which fall from this horrible
precipice do foam and boil after the most hideous manner
imaginable, making an outrageous noise more terrible than that of
thunder, for when the wind blows out of the south their dismal
roaring may be heard more than fifteen leagues off." Upon Charles
Dickens the first and enduring effect, instant and lasting, of the
tremendous spectacle, was: "Peace—peace of mind, tranquility, calm
recollections of the dead, great thoughts of eternal rest and
happiness." The falls had a sanative influence upon Professor
Tyndall, for, "quickened by the emotions there aroused," he says,
"the blood sped exultingly through the arteries, abolishing
introspection, clearing the heart of all bitterness, and enabling one
to think with tolerance, if not with tenderness, upon the most
relentless and unreasonable foe." After Anthony Trollope had looked
upon the cataract he wrote: "Of all the sights on this earth of ours, I
know no other one thing so beautiful, so glorious and so powerful.
That fall is more graceful than Giotto's Tower, more noble than the
Apollo. The peaks of the Alps are not so astounding in their solitude.
The valleys of the Blue Mountains in Jamaica are less green. The
finished glaze of life in Paris is less invariable; and the full tide of
trade around the Bank of England is not so inexorably powerful."
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.
textbookfull.com