Python Programming An Introduction to Computer Science John M. Zelle - The latest ebook edition with all chapters is now available
Python Programming An Introduction to Computer Science John M. Zelle - The latest ebook edition with all chapters is now available
https://ebookultra.com/download/the-art-science-of-java-an-
introduction-to-computer-science-1st-edition-eric-roberts/
https://ebookultra.com/download/quantum-computer-science-an-
introduction-1st-edition-n-david-mermin/
https://ebookultra.com/download/introduction-to-computing-and-
programming-in-python-a-multimedia-approach-mark-j-guzdial/
https://ebookultra.com/download/systematic-theology-an-introduction-
to-christian-belief-1st-edition-john-m-frame/
https://ebookultra.com/download/introduction-to-programming-with-
java-3rd-edition-john-dean/
https://ebookultra.com/download/introduction-to-python-for-science-
and-engineering-second-edition-david-j-pine/
https://ebookultra.com/download/a-computer-science-tapestry-exploring-
programming-and-computer-science-with-c-2nd-edition-owen-l-astrachan/
Python Programming An Introduction to Computer
Science John M. Zelle Digital Instant Download
Author(s): John M. Zelle
ISBN(s): 9781887902991, 1887902996
Edition: Pap/Cdr
File Details: PDF, 1.20 MB
Year: 2003
Language: english
Python Programming:
An Introduction to Computer Science
Version 1.0rc2
Fall 2002
Copyright c 2002 by John M. Zelle
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted,
in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without prior
written permission of the author.
This document was prepared with LATEX 2ε and reproduced by Wartburg College Printing Services.
Contents
i
ii CONTENTS
6 Defining Functions 85
6.1 The Function of Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
6.2 Functions, Informally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
6.3 Future Value with a Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
6.4 Functions and Parameters: The Gory Details . . . . . . . . . . . . . . . . . . . . . . . . . . 90
6.5 Functions that Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
6.6 Functions and Program Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
6.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Almost everyone has used a computer at one time or another. Perhaps you have played computer games or
used a computer to write a paper or balance your checkbook. Computers are used to predict the weather,
design airplanes, make movies, run businesses, perform financial transactions, and control factories.
Have you ever stopped to wonder what exactly a computer is? How can one device perform so many
different tasks? These basic questions are the starting point for learning about computers and computer
programming.
1
2 CHAPTER 1. COMPUTERS AND PROGRAMS
Output Devices
CPU
Input Devices
Secondary
Main Memory
Memory
analysis. For most problems, the bottom-line is whether a working, reliable system can be built. Often we
require empirical testing of the system to determine that this bottom-line has been met. As you begin writing
your own programs, you will get plenty of opportunities to observe your solutions in action.
You don’t have to know all the details of how a computer works to be a successful programmer, but under-
standing the underlying principles will help you master the steps we go through to put our programs into
action. It’s a bit like driving a car. Knowing a little about internal combustion engines helps to explain why
you have to do things like fill the gas tank, start the engine, step on the accelerator, etc. You could learn
to drive by just memorizing what to do, but a little more knowledge makes the whole process much more
understandable. Let’s take a moment to “look under the hood” of your computer.
Although different computers can vary significantly in specific details, at a higher level all modern digital
computers are remarkably similar. Figure 1.1 shows a functional view of a computer. The central processing
unit (CPU) is the “brain” of the machine. This is where all the basic operations of the computer are carried
out. The CPU can perform simple arithmetic operations like adding two numbers and can also do logical
operations like testing to see if two numbers are equal.
The memory stores programs and data. The CPU can only directly access information that is stored in
main memory (called RAM for Random Access Memory). Main memory is fast, but it is also volatile. That is,
when the power is turned off, the information in the memory is lost. Thus, there must also be some secondary
memory that provides more permanent storage. In a modern personal computer, this is usually some sort of
magnetic medium such as a hard disk (also called a hard drive) or floppy.
Humans interact with the computer through input and output devices. You are probably familiar with
common devices such as a keyboard, mouse, and monitor (video screen). Information from input devices is
processed by the CPU and may be shuffled off to the main or secondary memory. Similarly, when information
needs to be displayed, the CPU sends it to one or more output devices.
So what happens when you fire up your favorite game or word processing program? First, the instructions
that comprise the program are copied from the (more) permanent secondary memory into the main memory
of the computer. Once the instructions are loaded, the CPU starts executing the program.
Technically the CPU follows a process called the fetch execute cycle. The first instruction is retrieved
from memory, decoded to figure out what it represents, and the appropriate action carried out. Then the next
instruction is fetched, decoded and executed. The cycle continues, instruction after instruction. This is really
all the computer does from the time that you turn it on until you turn it off again: fetch, decode, execute. It
doesn’t seem very exciting, does it? But the computer can execute this stream of simple instructions with
blazing speed, zipping through millions of instructions each second. Put enough simple instructions together
in just the right way, and the computer does amazing things.
4 CHAPTER 1. COMPUTERS AND PROGRAMS
load the number from memory location 2001 into the CPU
load the number from memory location 2002 into the CPU
Add the two numbers in the CPU
store the result into location 2003
This seems like a lot of work to add two numbers, doesn’t it? Actually, it’s even more complicated than this
because the instructions and numbers are represented in binary notation (as sequences of 0s and 1s).
In a high-level language like Python, the addition of two numbers can be expressed more naturally: c =
a + b. That’s a lot easier for us to understand, but we need some way to translate the high-level language
into the machine language that the computer can execute. There are two ways to do this: a high-level language
can either be compiled or interpreted.
A compiler is a complex computer program that takes another program written in a high-level language
and translates it into an equivalent program in the machine language of some computer. Figure 1.2 shows
a block diagram of the compiling process. The high-level program is called source code, and the resulting
machine code is a program that the computer can directly execute. The dashed line in the diagram represents
the execution of the machine code.
An interpreter is a program that simulates a computer that understands a high-level language. Rather than
translating the source program into a machine language equivalent, the interpreter analyzes and executes the
source code instruction by instruction as necessary. Figure 1.3 illustrates the process.
The difference between interpreting and compiling is that compiling is a one-shot translation; once a
program is compiled, it may be run over and over again without further need for the compiler or the source
code. In the interpreted case, the interpreter and the source are needed every time the program runs. Compiled
programs tend to be faster, since the translation is done once and for all, but interpreted languages lend
themselves to a more flexible programming environment as programs can be developed and run interactively.
The translation process highlights another advantage that high-level languages have over machine lan-
guage: portability. The machine language of a computer is created by the designers of the particular CPU.
1.6. THE MAGIC OF PYTHON 5
Source
Code Compiler Machine
(Program) Code
Running
Outputs
Inputs Program
Source
Code Computer
(Program)
Running an
Outputs
Interpreter
Inputs
Each kind of computer has its own machine language. A program for a Pentium CPU won’t run on a Mac-
intosh that sports a PowerPC. On the other hand, a program written in a high-level language can be run on
many different kinds of computers as long as there is a suitable compiler or interpreter (which is just another
program). For example, if I design a new computer, I can also program a Python interpreter for it, and then
any program written in Python can be run on my new computer, as is.
The is a Python prompt indicating that the Genie is waiting for us to give it a command. In programming
languages, a complete command is called a statement.
Here is a sample interaction with the Python interpreter.
6 CHAPTER 1. COMPUTERS AND PROGRAMS
Here I have tried out three examples using the Python print statement. The first statement asks Python to
display the literal phrase Hello, World. Python responds on the next line by printing the phrase. The second
print statement asks Python to print the sum of 2 and 3. The third print combines these two ideas.
Python prints the part in quotes “2 + 3 =” followed by the result of adding 2 + 3, which is 5.
This kind of interaction is a great way to try out new things in Python. Snippets of interactive sessions
are sprinkled throughout this book. When you see the Python prompt in an example, that should tip
you off that an interactive session is being illustrated. It’s a good idea to fire up Python and try the examples
for yourself.
Usually we want to move beyond snippets and execute an entire sequence of statements. Python lets us
put a sequence of statements together to create a brand-new command called a function. Here is an example
of creating a new function called hello.
>>>
The first line tells Python that we are defining a new function called hello. The following lines are indented
to show that they are part of the hello function. The blank line (obtained by hitting the <Enter> key
twice) lets Python know that the definition is finished, and the interpreter responds with another prompt.
Notice that the definition did not cause anything to happen. We have told Python what should happen when
the hello function is used as a command; we haven’t actually asked Python to perform it yet.
A function is invoked by typing its name. Here’s what happens when we use our hello command.
>>> hello()
Hello
Computers are Fun
>>>
Do you see what this does? The two print statements from the hello function are executed in sequence.
You may be wondering about the parentheses in the definition and use of hello. Commands can have
changeable parts called parameters that are placed within the parentheses. Let’s look at an example of a
customized greeting using a parameter. First the definition:
>>> greet("John")
Hello John
How are you?
>>> greet("Emily")
Hello Emily
How are you?
>>>
1.6. THE MAGIC OF PYTHON 7
Can you see what is happening here? When we use greet we can send different names to customize the
result. We will discuss parameters in detail later on. For the time being, our functions will not use parameters,
so the parentheses will be empty, but you still need to include them when defining and using functions.
One problem with entering functions interactively at the Python prompt like this is that the definitions go
away when we quit Python. If we want to use them again the next time, we have to type them all over again.
Programs are usually created by typing definitions into a separate file called a module or script. This file is
saved on a disk so that it can be used over and over again.
A module file is just a text file, and you can create one using any program for editing text, like a notepad or
word processor program (provided you save your program as a “plain text” file). A special type of program
known as a programming environment simplifies the process. A programming environment is specifically
designed to help programmers write programs and includes features such as automatic indenting, color high-
lighting, and interactive development. The standard Python distribution includes a programming environment
called Idle that you may use for working on the programs in this book.
Let’s illustrate the use of a module file by writing and running a complete program. Our program will
illustrate a mathematical concept known as chaos. Here is the program as we would type it into Idle or some
other editor and save in a module file:
# File: chaos.py
# A simple program illustrating chaotic behavior.
def main():
print "This program illustrates a chaotic function"
x = input("Enter a number between 0 and 1: ")
for i in range(10):
x = 3.9 * x * (1 - x)
print x
main()
This file should be saved with with the name chaos.py. The .py extension indicates that this is a
Python module. You can see that this particular example contains lines to define a new function called main.
(Programs are often placed in a function called main.) The last line of the file is the command to invoke
this function. Don’t worry if you don’t understand what main actually does; we will discuss it in the next
section. The point here is that once we have a program in a module file, we can run it any time we want.
This program can be run in a number of different ways that depend on the actual operating system and
programming environment that you are using. If you are using a windowing system, you can run a Python
program by (double-)clicking on the module file’s icon. In a command-line situation, you might type a
command like python chaos.py. If you are using Idle (or another programming environment) you can
run a program by opening it in the editor and then selecting a command like import, run, or execute.
One method that should always work is to start the Python interpreter and then import the file. Here is
how that looks.
>>> import chaos
This program illustrates a chaotic function
Enter a number between 0 and 1: .25
0.73125
0.76644140625
0.698135010439
0.82189581879
0.570894019197
0.955398748364
0.166186721954
0.540417912062
0.9686289303
0.118509010176
>>>
8 CHAPTER 1. COMPUTERS AND PROGRAMS
Typing the first line import chaos tells the Python interpreter to load the chaos module from the file
chaos.py into main memory. Notice that I did not include the .py extension on the import line; Python
assumes the module will have a .py extension.
As Python imports the module file, each line executes. It’s just as if we had typed them one-by-one at the
interactive Python prompt. The def in the module causes Python to create the main function. When Python
encounters the last line of the module, the main function is invoked, thus running our program. The running
program asks the user to enter a number between 0 and 1 (in this case, I typed “.25”) and then prints out a
series of 10 numbers.
When you first import a module file in this way, Python creates a companion file with a .pyc extension.
In this example, Python creates another file on the disk called chaos.pyc. This is an intermediate file used
by the Python interpreter. Technically, Python uses a hybrid compiling/interpreting process. The Python
source in the module file is compiled into more primitive instructions called byte code. This byte code (the
.pyc) file is then interpreted. Having a .pyc file available makes importing a module faster the second time
around. However, you may delete the byte code files if you wish to save disk space; Python will automatically
re-create them as needed.
A module only needs to be imported into a session once. After the module has been loaded, we can run the
program again by asking Python to execute the main command. We do this by using a special dot notation.
Typing chaos.main() tells Python to invoke the main function in the chaos module. Continuing with
our example, here is how it looks when we rerun the program with 26 as the input.
>>> chaos.main()
Enter a number between 0 and 1: .26
0.75036
0.73054749456
0.767706625733
0.6954993339
0.825942040734
0.560670965721
0.960644232282
0.147446875935
0.490254549376
0.974629602149
>>>
# File: chaos.py
# A simple program illustrating chaotic behavior.
These lines are called comments. They are intended for human readers of the program and are ignored by
Python. The Python interpreter always skips any text from the pound sign (#) through the end of a line.
The next line of the program begins the definition of a function called main.
def main():
Strictly speaking, it would not be necessary to create a main function. Since the lines of a module are
executed as they are loaded, we could have written our program without this definition. That is, the module
could have looked like this:
1.7. INSIDE A PYTHON PROGRAM 9
# File: chaos.py
# A simple program illustrating chaotic behavior.
print x
x = 3.9 * x * (1 - x)
print x
Obviously using the loop instead saves the programmer a lot of trouble.
But what exactly do these statements do? The first one performs a calculation.
x = 3.9 * x * (1 - x)
This is called an assignment statement. The part on the right side of the = is a mathematical expression.
Python uses the * character to indicate multiplication. Recall that the value of x is 0 25 (from the input
statement). The computed value is 3 9 0 25 1 0 25 or 0 73125. Once the value on the righthand side is
computed, it is stored back (or assigned) into the variable that appears on the lefthand side of the =, in this
case x. The new value of x (0 73125) replaces the old value (0 25).
The second line in the loop body is a type of statement we have encountered before, a print statement.
print x
When Python executes this statement the current value of x is displayed on the screen. So, the first number
of output is 0.73125.
Remember the loop executes 10 times. After printing the value of x, the two statements of the loop are
executed again.
x = 3.9 * x * (1 - x)
print x
Of course, now x has the value 0 73125, so the formula computes a new value of x as 3 9 0 73125 1
Can you see how the current value of x is used to compute a new value each time around the loop? That’s
where the numbers in the example run came from. You might try working through the steps of the program
yourself for a different input value (say 0 5). Then run the program using Python and see how well you did
impersonating a computer.
This is called a logistic function. It models certain kinds of unstable electronic circuits and is also sometimes
used to predict population under limiting conditions. Repeated application of the logistic function can pro-
duce chaos. Although our program has a well defined underlying behavior, the output seems unpredictable.
An interesting property of chaotic functions is that very small differences in the initial value can lead to
large differences in the result as the formula is repeatedly applied. You can see this in the chaos program by
entering numbers that differ by only a small amount. Here is the output from a modified program that shows
the results for initial values of 0 25 and 0 26 side by side.
0.166187 0.960644
0.540418 0.147447
0.968629 0.490255
0.118509 0.974630
With very similar starting values, the outputs stay similar for a few iterations, but then differ markedly. By
about the fifth iteration, there no longer seems to be any relationship between the two models.
These two features of our chaos program, apparent unpredictability and extreme sensitivity to initial
values, are the hallmarks of chaotic behavior. Chaos has important implications for computer science. It
turns out that many phenomena in the real world that we might like to model and predict with our computers
exhibit just this kind of chaotic behavior. You may have heard of the so-called butterfly effect. Computer
models that are used to simulate and predict weather patterns are so sensitive that the effect of a single
butterfly flapping its wings in New Jersey might make the difference of whether or not rain is predicted in
Peoria.
It’s very possible that even with perfect computer modeling, we might never be able to measure existing
weather conditions accurately enough to predict weather more than a few days in advance. The measurements
simply can’t be precise enough to make the predictions accurate over a longer time frame.
As you can see, this small program has a valuable lesson to teach users of computers. As amazing as
computers are, the results that they give us are only as useful as the mathematical models on which the
programs are based. Computers can give incorrect results because of errors in programs, but even correct
programs may produce erroneous results if the models are wrong or the initial inputs are not accurate enough.
1.9 Exercises
1. Compare and contrast the following pairs of concepts from the chapter.
2. List and explain in your own words the role of each of the five basic functional units of a computer
depicted in Figure 1.1.
3. Write a detailed algorithm for making a peanut butter and jelly sandwich (or some other simple every-
day activity).
4. As you will learn in a later chapter, many of the numbers stored in a computer are not exact values, but
rather close approximations. For example, the value 0.1, might be stored as 0.10000000000000000555.
Usually, such small differences are not a problem; however, given what you have learned about chaotic
behavior in Chapter 1, you should realize the need for caution in certain situations. Can you think of
examples where this might be a problem? Explain.
5. Trace through the Chaos program from Section 1.6 by hand using 0 15 as the input value. Show the
sequence of output that results.
6. Enter and run the Chaos program from Section 1.6 using whatever Python implementation you have
available. Try it out with various values of input to see that it functions as described in the chapter.
7. Modify the Chaos program from Section 1.6 using 2.0 in place of 3.9 as the multiplier in the logistic
function. Your modified line of code should look like this:
12 CHAPTER 1. COMPUTERS AND PROGRAMS
x = 2.0 * x * (1 - x)
Run the program for various input values and compare the results to those obtained from the original
program. Write a short paragraph describing any differences that you notice in the behavior of the two
versions.
8. Modify the Chaos program from Section 1.6 so that it prints out 20 values instead of 10.
9. (Advanced) Modify the Chaos program so that it accepts two inputs and then prints a table with two
columns similar to the one shown in Section 1.8. (Note: You will probably not be able to get the
columns to line up as nicely as those in the example. Chapter 4 discusses how to print numbers with a
fixed number of decimal places.)
Other documents randomly have
different content
The next advice which, the Ras said, this devil, or angel, gave him,
was, that they should set fire to the town of Gondar, and burn it to
the ground, otherwise his good fortune was to leave him there for
ever; and for this there was a great number of advocates, Michael
seeming to lean that way himself. But, when it was reported to the
king, that young prince put a direct negative upon it, by declaring
that he would rather stay in Gondar, and fall by the hands of his
enemies, than either conquer them, or escape from them, by the
commission of so enormous a crime. When this was publicly known,
it procured the king universal good-will, as was experienced
afterwards, when he and Michael were finally defeated, and taken
prisoners, upon their march in return to Gondar.
Being now safely arrived on the banks of the Tacazzè, the first
province beyond which is that of Sirè, Michael sent before him Ayto
Tesfos the governor, a man exceedingly beloved, to assemble all sort
of assistance for passing the river. Every one flocked to the stream
with the utmost alacrity; the water was deep, and the baggage wet
in crossing, but the bottom was good and hard; they passed both
expeditiously and safely, and were received in Siré, and then in
Tigré, with every demonstration of joy.
On the 20th, the queen’s servants, who had gone to offer terms of
reconciliation to Fasil on the part of Gusho and Powussen, returned
to their homes. The same day he ordered it to be proclaimed in the
market-place, That Ayto Tesfos should be governor of Samen, and
that whoever should rob on that road, or commit any violence,
should suffer death. This was an act of power, purposely intended to
affront Powussen and Gusho, and seemed to be opening a road for a
correspondence with Ras Michael; but, above all, it shewed
contempt for their party and their cause, and that he considered his
own as very distinct from theirs; for Tesfos had taken arms in the
late king’s lifetime, at the same time, and upon the same principles
and provocation, as Fasil, and had never laid down his arms, or
made peace with Ras Michael, but kept his government in defiance
of him.
On the 24th, for fear of giving umbrage, I waited upon Gusho and
Powussen at Gondar. I saw them in the same room where Ras
Michael used to sit. They were both lying on the floor playing at
draughts, with the figure of a draught-table drawn with chalk upon
the carpet; they offered no other civility or salutation, but, shaking
me each by the hand, they played on, without lifting their heads, or
looking me in the face.
Gusho began by asking me, “Would it not have been better if you
had gone with me to Amhara, as I desired you, when I saw you last
at Gondar? you would have saved yourself a great deal of fatigue
and trouble in that dangerous march through Maitsha.” To this I
answered, “It is hard for me, who am a stranger, to know what is
best to be done in such a country as this. I was, as you may have
heard, the king’s guest, and was favoured by him; it was my duty
therefore to attend him, especially when he desired it; and such I
am informed has always been the custom of the country; besides,
Ras Michael laid his commands upon me.” On this, says Powussen,
shaking his head, “You see he cannot forget Michael and the Tigré
yet.”—“Very naturally, added Gusho, they were good to him; he was
a great man in their time; they gave him considerable sums of
money, and he spent it all among his own soldiers, the king’s guard,
which they had given him to command after the Armenian. Yagoube
taught him and his brother George to ride on horseback like the
Franks, and play tricks with guns and pikes on horseback; folly, all of
it to be sure, but I never heard he meddled in affairs, or that he
spoke ill of any one, much less did any harm, like those rascals the
Greeks when they were in favour in Joas’s time, for it was not their
fault they did not direct every thing.”—“I hope I never did, said I;
sure I am I never so intended, nor had I any provocation. I have
received much good usage from every one; and the honour, if I do
not forget, of a great many professions and assurances of friendship
from you, said I, turning to Gusho. He hesitated a little, and then
added very superciliously, “Aye, aye, we were, as I think, always
friends.”—“You have had, says Powussen, a devilish many hungry
bellies since we left Gondar.”—“You will excuse me, Sir, replied I, as
to that article; I at no time ever found any difference whether you
was in Gondar or not.”—“There, says Gusho, by St Demetrius, there
is a truth for you, and you don’t often hear that in Begemder. May I
suffer death if ever you gave a jar of honey to any white man in
your life.”—“But I, says Powussen, sitting upright on the floor, and
leaving off play, will give you, Yagoube, a present better than
Gusho’s paultry jars of honey. I have brought with me, addressing
himself to me, your double-barrelled gun, and your sword, which I
took from that son of a wh—e Guebra Mehedin: by St Michael,
continued Powussen, if I had got hold of that infidel I would have
hanged him upon the first tree in the way for daring to say that he
was one of my army when he committed that unmanly robbery upon
your people. The Iteghé, your friend, would yesterday have given
me ten loads of wheat for your gun, for she believes I am to carry it
back to Begemder again, and do not mean to give it you, but come
to my tent to-morrow and you shall have it.” I very well understood
his meaning, and that he wanted a present; but was happy to
recover my gun at any rate.
I arose to get away, as what had passed did not please me; for
before the king’s retreat to Tigré, Gusho had sat in my presence
uncovered to the waist, in token of humility, and many a cow, many
a sheep, and jar of honey he had sent me; but my importance was
now gone with the king; I was fallen! and they were resolved, I saw,
to make me sensible of it. I told the queen, on my return, what had
passed. They are both brutes, said she; but Gusho should have
known better.
The next morning, being the 25th, about eight o’clock, I went to
Powussen’s tent. His camp was on the Kahha, near the church of
Ledata, or the Nativity. After waiting near an hour, I was admitted;
two women sat by him, neither handsome nor cleanly dressed; and
he returned me my gun and sword, which was followed by a small
present on my part. This, says he, turning to the women, is a man
who knows every thing that is to come; who is to die, and who is to
live; who is to go to the devil, and who not; who loves her husband,
and who cuckolds him.”—“Tell me then, Yagoube, says one of the
women, will Tecla Haimanout and Michael ever come to Gondar
again?”—“I do not know who you mean, Madam, said I; is it the
king and the Ras you mean?”—“Call him the King, says the other
woman in half a whisper; he loves the king.”—“Well, aye, come, let it
be the king then, says she; will the King and Ras Michael ever come
to Gondar?”—“Surely, said I, the king is king, and will go to any part
of his dominions he pleases, and when he pleases; do you not hear
he is already on his way?”—“Aye, aye, by G—d, says Powussen, no
fear he’ll come with a vengeance, therefore I think it is high time
that I was in Begemder.” He then shrugged up his shoulders, and
rose, upon which I took my leave. He had kept me standing all the
time; and when I came to Koscam I made my report as usual to the
Iteghé, who laughed very heartily, though the king’s arrival, which
was prophecied, was likely to be a very serious affair to her.
That very day, in the evening, came a servant from Ras Michael,
with taunts and severe threats to the queen, to Powussen, and
Gusho; he said he was very quickly bringing the king back to Gondar,
and being now old, intended to pass the rest of his life in Tigré; he,
therefore, hoped they would await the king’s coming to Gondar, and
chuse a Ras for his successor from among themselves, as he
understood they were all friends, and would easily agree, especially
as it was to oblige him.
On the 27th, Gusho and Powussen waited upon the queen to take
their leave. They declared it was not their intention to stay at
Gondar, merely to be alternately the subject of merriment and
scoffing to Michael and to Fasil, and upon this they immediately set
out on their way home, without drum or trumpet, or any parade
whatever.
Upon the return of the Iteghé that night to Koscam, Sanuda held a
council of the principal officers that had remained at Gondar, and
fixed upon one Welleta Girgis, a young man of about 24 years of
age, who had, indeed, been reputed Yasous’s son, but his low life
and manners had procured him safety and liberty by the contempt
they had raised in Ras Michael. His mother, indeed, was of a noble
origin, but so reduced in fortune as to have been obliged to gain her
livelihood by carrying jars of water for hire. The mother swore this
son was begot by Yasous, and as that prince was known not to have
been very nice in his choice of mistresses, or limited in their number,
it was, perhaps, as likely to be true as not, that Welleta Girgis was
his son. He took the name of Socinios. On the morning after, the
new king came to Koscam, attended by Sanuda and his party, with
guards, and all the ensigns of royalty. He threw himself at the
Iteghé’s feet, and begged her forgivenness if he had vindicated the
rights of his birth, without her leave or participation; he declared his
resolution to govern entirely by her advice, and begged her to grant
his request and come to Gondar, and again take possession of her
place as Iteghé, or regent of the kingdom.
Immediately upon this confession, the Galla was carried out and
hanged upon the daroo-tree before the king’s gate. Many
condemned this hasty execution, but many likewise thought it
prudent; for he had already named a great part of the people about
the queen as accessary to the death of her son.
I have said his name was Zor Woldo; he was of the race of Galla,
called Toluma, on the borders of Amhara; he had been formerly a
servant to Kasmati Becro; was of small stature, thin and lightly
made; his complexion a yellowish black, and singularly ill-favoured.
When under the tree, he acknowledged the murder of the king with
absolute indifference; nor did he desire any favour, or shew any fear
of death. Zor Woldo’s examination and declaration were sent
immediately to Fasil, who, as usual, promised to come to Gondar
quickly. The body of Joas was raised also, and laid in the church (in
his clothes, just as he was dug up) upon a little straw; his features
were easily distinguishable, but some animal had ate part of his
cheek.
The priest received the carpet with great marks of satisfaction, and
told me it was he who had challenged the murderers when carrying
the body over the wall; that he knew them well, and suspected they
had been about some mischief; and, upon hearing the king was
missing the next day, he was firmly convinced it was his body that
had been buried. Upon going also to the place early in the morning,
he had found one of the king’s toes, and part of his foot, not quite
covered with earth, from the haste the murderers were in when they
buried him; these he had put properly out of sight, and constantly
ever after, as he said, had watched the place in order to hinder the
grave from being disturbed, or any other person being buried there.
The time being come, he informed me Ras Michael and Fasil had
made peace; Welleta Michael, the Ras’s nephew, taken by Fasil at
the battle of Limjour, had been the mediator; that the king and
Michael, by their wise behaviour, had reconciled Tigré as one man,
and that the Ras had issued a proclamation, remitting to the
province of Tigré their whole taxes from the day they passed the
Tacazzé till that time next year, in consideration of their fidelity and
services; and this had been solemnly proclaimed in several places by
beat of drum. The Ras declared, at the same time, that he would,
out of his own private fortune, without other assistance, bear the
expence of the campaign till he seated the king on his throne in
Gondar. A kind of madness, he said, had seized all ranks of people to
follow their sovereign to the capital; that the mountain Haramat still
held out; but that all the principal friends, both of Za Menfus and
Netcho, had been up with the governors of that fortress offering
terms of peace and forgivenness, and desiring they would not be an
obstacle in the king’s way, and a hinderance to his return, but that
all terms had been as yet refused; however, says he, you know the
Ras as well as I, he will play them a trick some of these days,
winking with his eye, and then crying out, Drink!
I asked him if any notice had been taken of the carpet I had
procured to cover the body of Joas, and hoped it had given no
umbrage. He said, “No; none at all; on the contrary, the king had
said twenty kind things upon it; that he was present also when a
priest told it to Ras Michael, who only observed, Yagoube, who is a
stranger in this country, is shocked to see a man taken out of his
grave, and thrown like a dog upon the bare floor. This was all
Michael said, and he never mentioned a word on the subject
afterwards;” nor did he, or the king, ever speak of it to me upon
their return to Gondar.
The Iteghé, too, had much commended me, so did all the nobility,
more than the thing deserved; for surely common humanity dictated
thus much, and the fear of Michael, which I had not, was the only
cause that so proper an action was left in a stranger’s power. Even
Ozoro Esther, enemy to Joas on account of the death of her husband
Mariam Barea, after I had attended her one Sunday from church to
the house of the Iteghé, and when she was set down at the head of
a circle of all those that were of distinction at the court, called out
aloud to me, as I was passing behind, and pointing to one of the
most honourable seats in the room, said, Sit down there, Yagoube;
God has exalted you above all in this country, when he has put it in
your power, though but a stranger, to confer charity upon the king of
it. All was now acclamation, especially from the ladies; and, I
believe, I may safely say, I had never in my life been a favourite of
so many at one time.
I dispatched Guebra Selassé with a message to the king, that I was
resolved now to try once more a journey to the head of the Nile;
that I thought I should have time to be there, and return to Gondar,
before the Tacazzé was fordable, soon after which I expected he
would cross it, and that nothing but want of health would prevent
me from joining him in Belessen, or sooner, if any opportunity should
offer.
Before I took my last resolutions I waited upon the queen. She was
exceedingly averse to the attempt; she bade me remember what the
last trial had cost me; and begged me to defer any further thoughts
of it till Fasil arrived in Gondar; that she would then deliver me into
his hands, and procure from him sure guides, together with a safe
conduct. She bade me beware also of troops of Pagan Galla which
were passing and repassing to and from his army, who, if they fell in
with me, would murder me without mercy. She added, that the
priests of Gojam and Damot were mortal enemies to all men of my
colour, and, with a word, would raise the peasants against me. This
was all true; but then many reasons, which I had weighed well,
concurred to shew that this opportunity, dangerous as it was, might
be the only time in which my enterprise could be practicable; for I
was confident a speedy rupture between Fasil and Michael would
follow upon the king’s return to Gondar. I determined therefore to
set out immediately without farther loss of time.
CHAP. VIII.
Second Journey to discover the Source of the Nile—Favourable Turn
of the King’s Affairs in Tigré—We fall in with Fasil’s Army at Bamba.
But, about twelve o’clock, I was told a message from Ras Michael
had arrived with great news from Tigré. I went immediately to
Koscam as fast as I could gallop, and found there Guebra Christos, a
man used to bring the jars of bouza to Ras Michael at his dinner and
supper: low men are always employed on such errands, that they
may not, from their consequence excite a desire of vengeance. The
message that he brought was to order bread and beer to be ready
for 30,000 men who were coming with the king, as he had just
decamped from before the mountain Haramat, which he had taken,
and put Za Menfus to the sword, with every man that was in it: this
message struck the queen with such a terror that she was not visible
the whole day.
After asking the messenger if he had any word from the king to me,
he said, “Very little;” that the king had called him to tell me he
should soon begin his march by Belessen; and that he would send
for me to meet him when he should arrive at Mariam-Ohha; he told
me besides, that the king had got a stone for me with writing upon
it of old times, which he was bringing to me; that it had been dug up
at Axum, and was standing at the foot of his bed, but that he did not
order him to tell me this, and had only learned it from the servants.
My curiosity was very much raised to know what this stone could be,
but I soon saw it was in vain to endeavour to learn any thing from
Guebra Christos; he answered in the affirmative to every inquiry:
when I asked if it was blue, it was blue; and if black, it was black; it
was round, and square, and oblong, just as I put my question to
him: all he knew about it at last, he said, was, that it cured all sort
of sickness; and, if a man used it properly, it made him invulnerable
and immortal: he did not, however, pretend to warrant this himself,
but swore he had the account from a priest of Axum who knew it. I
was perfectly satisfied all further inquiry was unnecessary; he had
got a very plentiful portion of bouza from his friends, and was, I
saw, fast engaged in the pursuit of more, so I gave him a small
present for his good news, and took my leave, my mind being full of
reflections upon the king’s goodness, who, after such an absence,
and in so critical a situation as he then was, still remembered the
trifling pursuits in which he had seen me often engaged.
It was on the 28th of October, at half past nine in the morning, that
we left Gondar, and passed the river Kahha at the foot of the town;
our route was W. S. W. the road a little rugged upon the side of a
hill, but the day was fair, with sunshine; and a small breeze from the
north had risen with the sun, and made the temperature of the air
perfectly agreeable. We left the church of Ledeta about a mile on
the right, and passed by several poor villages called Abba Samuel;
thence we came to the small river Shimfa, then to the Dumaza,
something larger. Upon the banks of this river, very pleasantly
situated, is Azazo, a country-house built by the late king Yasous,
who often retired here to relax himself with his friends. It is
surrounded, I may say covered, with orange-trees, so as to be
scarcely seen; the trees are grown very large and high; they are
planted without order, the only benefit expected from them being
the shade. At some small distance is the village Azazo, originally
built for the accommodation of the king’s servants while he resided
there, but now chiefly occupied by monks belonging to the large
church of Tecla Haimanout, which is on a little hill adjoining. Azazo,
though little, is one of the most chearful and pleasant villages in the
neighbourhood of Gondar. The lemon-tree seems to thrive better
and grow higher than the orange; but the house itself is going fast
to ruin, as the kings of this country have a fixed aversion to houses
built by their predecessors.
We had not many minutes been delivered from this torrent, before
we passed two other rivers, the one larger, the other smaller. All
these rivers come from the north-west, and have their sources in the
mountains a few miles above, towards Woggora, from which, after a
short course on the side of the hills, they enter the low, flat country
of Dembea, and are swallowed up in the Tzana.
There was one of the first and most magnificent churches and
monasteries of the Portuguese Jesuits, in the time of their mission to
convert this country: Socinios, then king, gave them the grounds,
with money for the expence; they built it with their own hands, and
lined it elegantly with cedar. The king, who was a zealous Roman
Catholic, chose afterwards a country-house for himself there, and
encouraged them much by his presents and by his charity; it is one
of the pleasantest situations in the world; the vast expanse of the
lake is before you; Dembea, Gojam, and Maitsha, flat and rich
countries all round, are in view; and the tops of the high hills of
Begemder and Woggora close the prospect.
The lake here, I am told, has plenty of fish, which is more than can
be said for many of the other parts of it; the fish are of two kinds,
both of them seemingly a species of what the English call bream. I
never could make them to agree with me, which I attribute to the
drug with which they are taken; it is of the nature of nux vomica,
pounded in a morter, and thrown into streams, where they run into
the lake; the fish, feeding there, are thus intoxicated and taken;
however, it would admit of a doubt of this being the reason, because
the queen and all the great people in Gondar eat them in Lent
without any bad consequences.
We turned out of the road to the left at Bab Baha, and were obliged
to go up the hill; in a quarter of an hour we reached the high road to
Mescala Christos. At seven o’clock we began to turn more to the
southward, our course being S. W.; three miles and a half on our
right remained the village of Tenkel; and four miles and a half that of
Tshemmera to the N. N. W.; we were now close to the border of the
lake, whose bottom here is a fine sand. Neither the fear of
crocodiles, nor other monsters in this large lake, could hinder me
from swimming in it for a few minutes. Though the sun was very
warm, the water was intensely cold, owing to the many fresh
streams that pour themselves continually into the lake Tzana from
the mountains. The country here is sown with dora, which is maize,
or millet; and another plant, not to be distinguished from our
marigold either in size, shape, or foliage; it is called Nook118, and
furnishes all Abyssinia with oil for the kitchen, and other uses.
This intelligence, which came all at once upon us, made us lay aside
the thoughts of sleeping that night; we descended the hill of
Mescala Christos in great haste, and with much difficulty, and came
to the river Kemon below it, clear and limpid, but having little water,
running over a bed of very large stones. This river, too, comes from
the north-west, and falls into the lake a little below; we rested on its
banks half an hour, the weather being very sultry; from this place we
had a distinct view of the Nile, where, after crossing the lake, it
issues out near Dara, the scene of our former misfortunes; we set it
carefully by the compass, and it bore nearly S. W.
We began our journey again at three quarters after two, and at half
after three we passed a river, very clear, with little water, the name
of which I have forgot; by the largeness of its bed it seemed to be a
very considerable stream in winter; at present it had very little water,
but a fine gravelly bottom; here we met multitudes of peasants
flying before the army of Fasil, many of whom, seeing us, turned out
of the way; one of these was a servant of Guebra Ehud, brother to
Ayto Aylo, my most intimate friend: he told us it was very possible
that Fasil would pass us that night, advised us not to linger in the
front of such an army, but fall in as soon as possible with his Fit-
Auraris, rather than any other of his advanced posts; he was
carrying a message to his master’s brother at Gondar. I told him I
had rather linger in the front of such an army than in the rear of it,
and should be very sorry to be detained long, even in the middle of
it; that I only wished to salute Fasil, and procure a pass and
recommendations from him to Agow Midre.
Ayto Aylo’s servant, who was with me, presently made acquaintance
with this man, and I trusted him to learn from him as much as he
knew about Fasil; the result was, that Fasil pretended to be in a
violent hurry, from what motive was not known; but that he, at the
same time, marched very slowly, contrary to his usual custom; that
his speech and behaviour promised peace, and that he had hurt
nobody on the way, but proclaimed constantly, that all people should
keep their houses without fear; that Ayto Woldo of Maitsha, a great
robber, was his Fit-Auraris, and never distant from him more than
three miles; that the troops of Agow, Maitsha, and Damot, were with
him, and with some Galla of Gojam and Metchakel composed the
van and center of his army, whilst his rear consisted of wild lawless
Galla, whom he had brought from the other side of the Nile from
Bizamo, his own country, and were commanded by Ayto Welleta
Yasous, his great confident; that these Galla were half a day
generally behind him, and there was some talk that, the same day,
or the next, he was to send these invaders home; that he marched
as if he was in fear; always took strong posts, but had received
every body that came to him, either from the country or Gondar,
affably and kindly enough, but no one knew any thing of his
intentions.
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.
ebookultra.com