100% found this document useful (5 votes)
33 views

Buy Ebook Programming and Problem Solving With Python 1st Edition - Ebook PDF Cheap Price

Python

Uploaded by

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

Buy Ebook Programming and Problem Solving With Python 1st Edition - Ebook PDF Cheap Price

Python

Uploaded by

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

Download the full version of the ebook now at ebooksecure.

com

Programming and Problem Solving with Python


1st Edition - eBook PDF

https://ebooksecure.com/download/programming-and-
problem-solving-with-python-ebook-pdf/

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


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

Problem Solving and Python Programming 1st edition - eBook


PDF

https://ebooksecure.com/download/problem-solving-and-python-
programming-ebook-pdf/

ebooksecure.com

(eBook PDF) Programming, Problem Solving and Abstraction


with C

https://ebooksecure.com/product/ebook-pdf-programming-problem-solving-
and-abstraction-with-c/

ebooksecure.com

Programming for Problem Solving- GTU 2018 - eBook PDF

https://ebooksecure.com/download/programming-for-problem-solving-
ebook-pdf/

ebooksecure.com

(eBook PDF) Language Development From Theory to Practice


3rd Edition

https://ebooksecure.com/product/ebook-pdf-language-development-from-
theory-to-practice-3rd-edition/

ebooksecure.com
(eBook PDF) American Courts and the Judicial Process 2nd
Edition

https://ebooksecure.com/product/ebook-pdf-american-courts-and-the-
judicial-process-2nd-edition/

ebooksecure.com

Applied Techniques to Integrated Oil and Gas Reservoir


Characterization: A Problem-Solution Discussion with
Geoscience Experts 1st Edition Enwenode Onajite (Editor) -
eBook PDF
https://ebooksecure.com/download/applied-techniques-to-integrated-oil-
and-gas-reservoir-characterization-a-problem-solution-discussion-with-
geoscience-experts-ebook-pdf/
ebooksecure.com

Corporate Finance 13th Edition Bradford D. Jordan Stephen


A. Ross - eBook PDF

https://ebooksecure.com/download/corporate-finance-ebook-pdf/

ebooksecure.com

(eBook PDF) Crime and Criminology: An Introduction to


Theory, Third Canadian Edition

https://ebooksecure.com/product/ebook-pdf-crime-and-criminology-an-
introduction-to-theory-third-canadian-edition/

ebooksecure.com

(eBook PDF) Gardner's Art through the Ages: A Concise


History of Western Art 3rd Edition

https://ebooksecure.com/product/ebook-pdf-gardners-art-through-the-
ages-a-concise-history-of-western-art-3rd-edition/

ebooksecure.com
Photo-induced corrosion or protection: Determining the
charge transfer in the semiconductor-metal heterojunction
- eBook PDF
https://ebooksecure.com/download/photo-induced-corrosion-or-
protection-determining-the-charge-transfer-in-the-semiconductor-metal-
heterojunction-ebook-pdf/
ebooksecure.com
PROGRAMMING AND PROBLEM SOLVING
WITH

PYTHON
About the Authors

Ashok Namdev Kamthane is a retired Associate Professor of the Department


of Electronics and Telecommunication Engineering, S. G. G. S. Institute of
Engineering and Technology, Nanded, Maharashtra, India. An academic with
37 years of teaching experience, he has authored more than a dozen books and
presented several technical papers at national and international conferences.
He has earned a first class in ME (Electronics) from S. G. G. S. College of
Engineering and Technology. His ME dissertation work from Bhabha Atomic
Research Center, Trombay, Mumbai, was on development of the hardware and
software using 8051 (8-bit microcontroller) Acoustic Transceiver System required in submarines.

Amit Ashok Kamthane is a Research Assistant at National Centre for Aerospace


Innovation and Research, IIT Bombay. In the past, he was associated as a
lecturer with S. G. G. S. Institute of Engineering and Technology, Nanded and
as an Assistant Professor with P. E. S Modern College, Pune. He completed his
ME (Computer Science and Engineering) from M. G. M. College of Engineering
and BE (Computer Science and Engineering) in first class from G. H. Raisoni
College of Engineering, Pune. A computer programming enthusiast, he also
imparts corporate training.
PROGRAMMING AND PROBLEM SOLVING
WITH

PYTHON
Ashok Namdev Kamthane
Retired Associate Professor
Department of Electronics and Telecommunication Engineering
Shri Guru Gobind Singhji Institute of Engineering and Technology, Nanded
Maharashtra, India

Amit Ashok Kamthane


Research Assistant
IIT Bombay
Maharashtra, India

McGraw Hill Education (India) Private Limited


CHENNAI
McGraw Hill Education Offices
Chennai New York St Louis San Francisco Auckland Bogotá Caracas
Kuala Lumpur Lisbon London Madrid Mexico City Milan Montreal
San Juan Santiago Singapore Sydney Tokyo Toronto
McGraw Hill Education (India) Private Limited
Published by McGraw Hill Education (India) Private Limited
444/1, Sri Ekambara Naicker Industrial Estate, Alapakkam, Porur, Chennai 600 116

Programming and Problem Solving with Python

Copyright © 2018 by McGraw Hill Education (India) Private Limited.


No part of this publication may be reproduced or distributed in any form or by any means, electronic, mechanical,
photocopying, recording, or otherwise or stored in a database or retrieval system without the prior written permission of
the publishers. The program listings (if any) may be entered, stored and executed in a computer system, but they may not
be reproduced for publication.

This edition can be exported from India only by the publishers,


McGraw Hill Education (India) Private Limited.

1 2 3 4 5 6 7 8 9 D103074 22 21 20 19 18
Printed and bound in India.
Print Edition
ISBN (13): 978-93-87067-57-8
ISBN (10): 93-87067-57-2
e-Book Edition
ISBN (13): 978-93-87067-58-5
ISBN (10): 93-87067-58-0
Managing Director: Kaushik Bellani
Director—Science & Engineering Portfolio: Vibha Mahajan
Senior Portfolio Manager—Science & Engineering: Hemant K Jha
Associate Portfolio Manager—Science & Engineering: Mohammad Salman Khurshid
Senior Manager—Content Development: Shalini Jha
Content Developer: Ranjana Chaube
Production Head: Satinder S Baveja
Assistant Manager—Production: Jagriti Kundu
General Manager—Production: Rajender P Ghansela
Manager—Production: Reji Kumar

Information contained in this work has been obtained by McGraw Hill Education (India), from sources believed to be reliable.
However, neither McGraw Hill Education (India) nor its authors guarantee the accuracy or completeness of any information
published herein, and neither McGraw Hill Education (India) nor its authors shall be responsible for any errors, omissions, or
damages arising out of use of this information. This work is published with the understanding that McGraw Hill Education
(India) and its authors are supplying information but are not attempting to render engineering or other professional services. If
such services are required, the assistance of an appropriate professional should be sought.

Typeset at APS Compugraphics, 4G, PKT 2, Mayur Vihar Phase-III, Delhi 96, and printed at

Cover Printer:

Visit us at: www.mheducation.co.in


Dedicated to

Sow Surekha Ashok Kamthane


(Mother of Amit Ashok Kamthane)
Preface

It gives us immense pleasure to bring the book ‘Programming and Problem Solving with Python’. The
book is intended for the students in initial years of engineering and mathematics who can use this
high-level programming language as an effective tool in mathematical problem solving. Python is
used to develop applications of any stream and it is not restricted only to computer science.
We believe that anyone who has basic knowledge of computer and ability of logical thinking can
learn programming. With this motivation, we have written this book in a lucid manner. Once you
go through the book, you will know how simple the programming language is and at the same
time you will learn the basics of python programming. You will feel motivated enough to develop
applications using python.
Since this book has been written with consideration that reader has no prior knowledge of
python programming, before going through all the chapters, reader should know what are the
benefits of learning python programming. Following are some of the reasons why one should
learn python language.
• Python language is simple and easy to learn. For example, it has simple syntax compared to
other programming languages.
• Python is an object-oriented programming language. It is used to develop desktop, standalone
and scripting applications.
• Python is also an example of free open source software. Due to its open nature one can write
programs and can deploy on any of platform, i.e., (Windows, Linux, Ubuntu and Mac OS),
without changing the original program.
Thus, due to the features enlisted above, python has become the most popular language and is
widely used among programmers.

Use of Python in Engineering Domains


Computer Engineering
Python is used in computer engineering
• To develop web applications
• By data scientists to analyse large amount of data
• In automation testing
viii Preface

• To develop GUI-based applications, cryptography and network security and many more
applications
Electronics and Telecommunication Engineering and Electrical Engineering
• Image processing applications can be developed by using python’s ‘scikit-image’ library
• Widely used in developing embedded applications
• Develop IOT applications using Arduino and Raspberry pi
Python can also be used in other engineering streams such as mechanical, chemical, and
bioinformatics to perform complex calculations by making use of numpy, scipy, and pandas library.
Thus, the end user of this book can be anyone who wants to learn basics of python programming.
To learn the basics, the student can be of any stream/any engineering/Diploma/BCA/MCA
background and interested to develop applications using python.

Organization of the Book


The book is organized into two parts. The first part covers fundamentals of computer programming
while the second part covers topics related to object-oriented programming and some basic topics
on data structures.
In the first part of the book, the readers will learn about basics of computer, basics of python
programming, executing python programs on various operating systems (Chapter 1), data
types used in python, assignments, formatting numbers and strings (Chapter 2) operators and
expressions (Chapter 3), decision statements (Chapter 4), loop control statements (Chapter 5) and
functions (Chapter 6).
In the second part, the readers will be introduced to creation of classes and objects. The concept
of creating list and strings using classes are discussed in Chapters 7 and 8. Reader will also
become aware of basic topics of data structures, i.e. searching and sorting (Chapter 9) since it is
one of the most important concept and used in almost all real-world applications. Various concepts
and features of object-oriented programming such as inheritance, accessibility, i.e. encapsulation
have been covered in Chapter 10. Chapter 11 comprises one of the major important data structures
of python, i.e. tuples, sets and dictionaries in great detail whereas Chapter 12 explains graphics
creation using turtle. Finally, Chapter 13 will help the readers to understand the need of file
handling and develop real-time applications based on it. Thus, after going through the second
part of the book, the readers will be in a position to create a software application by considering
flexibility, and reusability.

Online Learning Centre


The text is supported by additional content which can be accessed from the weblink
http://www.mhhe.com/kamthane/python. The weblink comprises
• Problems for practice
• Solutions Manual (for Instructors and Students)
• PPTs
• Useful web links for further reading
Visit https://testbankfan.com
now to explore a rich
collection of testbank or
solution manual and enjoy
exciting offers!
Preface ix

In the end, we would like to express gratitude to all our well-wishers and readers, whose
unstinted support and encouragement has kept us going as a teacher and author of this book. Any
suggestion regarding the improvement of the book will be highly appreciated.

ASHOK NAMDEV K AMTHANE


AMIT ASHOK K AMTHANE

Publisher’s Note
McGraw-Hill Education (India) invites suggestions and comments from you, all of which can be
sent to [email protected] (kindly mention the title and author name in the subject line).
Piracy-related issues may also be reported.
Visual W

All chapters within the book have been structured into the following important pedagogical
components:

Decision Statements
• Learning Outcomes give a clear idea to the 4
students and programmers on what they will
learn in each chapter. After completion of 4.1 Introduction
CHAPTER OUTLINE
4.6 Boolean Expressions and Relational
4.2 Boolean Type Operators
chapter, they will able to comprehend and apply 4.3
4.4
Boolean Operators
Using Numbers with Boolean Operators
4.7 Decision Making Statements
4.8 Conditional Expressions

all the objectives of the chapter. 4.5 Using String with Boolean Operators

LEARNING OUTCOMES

• Introduction explains the basics of each topic After completing this chapter, students will be able to:

bool

and familiarizes the reader to the concept being Boolean Relational > <,>= <= !=

if
dealt with. if
if else

if-elif-else

conditional expressions

4.1 INTRODUCTION

Write a program to create a list with elements 1,2,3,4 and 5. Display even elements of the list
PROGRAM 8.1 using list comprehension.

List1=[1,2,3,4,5]
print(“Content of List1”)
print(List1)
List1=[x for x in List1 if x%2==0]
print(“Even elements from the List1”)
print(List1)
• Programs are the highlighting
Output Generate 50 random numbers within a range 500 to 1000 and write them to file
feature of the chapters. Ample
PROGRAM 13.3
Content of List1
[1, 2, 3, 4, 5]
WriteNumRandom.txt.

from random import randint # Import Random Module


programs have been provided
[2, 4]
fp1 = open(“WriteNumRandom.txt”,”w”) # Open file in write mode
for x in range(51): #Iterates for 50 times
against each sub topic to effectively
x = randint(500,1000) #Generate one random number
x = str(x) #Convert Number to String
strengthen the learnt concepts.
fp1.write(x + “ “) #Write Number to Output file
fp1.close() #Finish Writing Close the file

Output File
Visual Walkthrough xi

• Mini Project consists of a problem MINI PROJECT Turtle Racing Game


statement that will compel the readers to three red green black

think and make use of various concepts


learnt to solve real-life problems through
programming.

Turtle Racing Track

penup(), pendown(),
forward(), right(), goto(), color(), shape(), speed() left()

Note: The del operator uses index to access the elements of a list. It gives a run time error if the index
• Notes have been inserted in each chapter
is out of range.
Example: to provide valuable insights based on
>>> del Lst[4]
Traceback (most recent call last):
programming concepts. Notes shall
File “<pyshell#37>”, line 1, in <module>
del Lst[4]
also act as precautionary statements for
IndexError: list assignment index out of range readers to solve programming problems
effectively.

SUMMARY
• A concise Summary has been listed at
chapter-end to reiterate vital points and
describes in short, the complex concepts
covered within the chapter.

• Key Terms enlists important keywords


and concepts covered within the chapter.
KEY TERMS

The def keyword:


Positional arguments:
• Extensive Review Questions presented Keyword arguments:
Local and global scope of a variable:

at the end of each chapter comprise The return keyword:


Lambda:

Multiple Choice Questions, True False REVIEW QUESTIONS


statements, Exercise Questions and
A. Multiple Choice Questions
Programming Assignments. This would
help in analyzing the learnt information.

x = 10
def f():
x= x + 10
print(x)
f()
Acknowledgements

We would like to express deep sense of gratitude to Professor B. M. Naik, former Principal of
S. G. G. S. College of Engineering and Technology, Nanded, who constantly praised and inspired
us to write books on technical subjects and whose enthusiasm and guidance led us to write this
book.
Special thanks are also due to Dr. L. M. Waghmare, Director, S. G. G. S. Institute of Engineering
and Technology, Professor Dr. U. V. Kulkarni, HOD, CSE and Professor P. S. Nalawade of S. G. G. S.
Institute of Engineering and Technology Nanded for encouraging us to write this book on Python.
We are grateful to Professor Dr. Mrs. S. A. Itkar, HOD, CSE and Professor Mrs. Deipali V. Gore
of P. E. S. Modern College of Engineering Pune, for supporting us while writing the book. We
are also thankful to the staff members (Santosh Nagargoje, Nilesh Deshmukh, Kunnal Khadake,
Digvijay Patil and Sujeet Deshpande) of P. E. S. Modern College of Engineering for their valuable
suggestions.
Furthermore, we would like to thank our friends—ShriKumar P. Ugale and Navneet Agrawal—
for giving valuable inputs while writing the book. Also, we would like to thank our students—
Suraj K, Pranav C, and Prajyot Gurav—who offered comments, suggestions and praise while
writing the book.
We are thankful to the following reviewers for providing useful feedback and critical suggestions
during the development of the manuscript.

Vikram Goyal IIIT Delhi


Partha Pakray NIT, Mizoram
Harish Sharma RTU, Kota
Shreedhara K.S. University BDT College of Engineering, Karnataka
S. Rama Sree Aditya Engineering College, Andhra Pradesh
Sansar Singh Chauhan IEC-CET, Greater Noida

Lastly, we are indebted to our family members—Mrs. Surekha Kamthane (mother of Amit
Kamthane), Amol, Swarupa, Aditya, Santosh Chidrawar, Sangita Chidrawar, Sakshi and Sartak for
their love, support and encouragement.

ASHOK NAMDEV K AMTHANE


AMIT ASHOK K AMTHANE
Exploring the Variety of Random
Documents with Different Content
aged naturalist, who had withdrawn from civilization and the life of
white people to settle in one of the remotest recesses of the
Amazonian jungle. Whether he was related to him, Bomba did not
know and had never wondered. He would not have known the
meaning of relative. He only knew that he loved Casson and that
Casson loved him, although the latter seldom demonstrated any
affection in words, spending days at a time in moody abstraction.
The old man’s state had grown worse after a certain memorable day
when he had fired a gun at an anaconda which was threatening to
attack Bomba and the weapon had burst in his hands. The reptile
was wounded by the flying missiles and retreated, but Casson had
received a serious injury to his head. Bomba nursed him back to
some degree of physical health, but Casson from that time on was
half-demented, and the care of providing for the two had fallen on
the lad’s shoulders.
For such youthful shoulders it was a heavy burden, but it helped to
develop the lad into a wonder of strength and daring. Dangers of all
kinds surrounded him, wild beasts and reptiles with which the jungle
swarmed, and only quick wit and dauntless courage could preserve
his life. But necessity is a hard taskmaster, and under its spur
Bomba learned all the craft of the jungle. Keen of eye, swift of foot,
supple of muscle, and strong of heart, he matched himself against
his foes and so far had come out the victor. He was now about
fourteen years old, but few grown men had his strength and
resources.
Of the outside world he knew nothing. All his life was circumscribed
by the jungle. Casson had started to give him a smattering of
learning, but the explosion of the rifle had brought this to an abrupt
stop.
So Bomba roamed the jungle like a young faun at the beginning of
the world. His face was as bronzed as that of an Indian from
constant exposure to sun and storm. But there was undeniable proof
in his features, in his aquiline nose, his firm jaw, his brown hair and
eyes, that he was of white blood. He wore the native tunic, or
mendiyeh, and a puma skin was slung across his breast—that of
Geluk the puma that he had come across and killed when it was
trying to slay the friendly parrots, Kiki and Woowoo. Beneath his
bare arms and legs powerful muscles glided and rippled. Homemade
sandals encased his feet.
His weapons consisted of a bow and arrows, and he wore at his belt
a machete, or two-edged knife, fully a foot in length, a fearful blade
when it came to hand-to-hand fighting. In addition he had a five-
chambered revolver, the only firearm of which he was possessed,
and which had been given to him by two white rubber hunters after
he had rendered them a signal service.
Despite its perils, he loved the life of the jungle, and but for one thing
would have been reasonably happy. That thing was the
consciousness of his white blood. It tugged at his heart, and while it
gave him pride, it also tormented him. The call of the blood was
strong within him. He knew that, somehow, he was out of place.
Something was always calling him to go elsewhere, beckoning him
on to new horizons, telling him that he belonged to the white people.
He had a great yearning to know of his parentage. He had not the
slightest memory of his father or mother. Again and again he had
questioned Casson on this point, but the old man’s memory always
failed him at the very moment of revelation. In these efforts to recall
the past Casson had frequently muttered the words “Bartow” and
“Laura,” and Bomba had inferred that the names were those of his
father and mother. But the further knowledge he craved was denied
him.
How Bomba saved the camp of Gillis and Dorn, rubber hunters, from
a night attack by jaguars—how he trapped the deadly cooanaradi,
the most dreaded serpent of the South American wilds, when it
pursued him; his adventures with alligators and anacondas; the
besieging of his cabin by the headhunters; how his friends of the
forest came to his aid when he was fearfully beset; all this is narrated
in the first volumes of this series, entitled: “Bomba, the Jungle Boy;
or, The Old Naturalist’s Secret.”
Later on, Casson told Bomba that, though he himself could not
remember the facts about the lad’s parentage, the latter could get
that information from Jojasta, the medicine man of the Moving
Mountain. Bomba, therefore, after providing for Casson’s safety
while he should be gone, set out to see Jojasta. From the very outset
his path was beset with perils. Flood and earthquake, man and beast
sought his life. He was instrumental in delivering from the hands of
the savages a Mrs. Parkhurst and her son, Frank, and his
association with the two deepened his desire to know more of that
white civilization with which they were so familiar. He was hurled into
a subterranean cavern, escaped by a hair’s breadth and finally
reached Jojasta and the Moving Mountain.
There disappointment awaited him; but he was told that if he could
find Sobrinini, the witch who dwelt near the Giant Cataract, she
might give him the knowledge for which his soul longed.
Baffled for a time but not disheartened, Bomba resolved to search
out Sobrinini, though warned that great peril would attend the
attempt. How true that warning was he soon had reason to learn. He
fell into the power of Nascanora and was doomed by him to torture
and death. How his quick wit saved him; the terrible dangers to
which his indomitable spirit refused to yield, and which he finally
surmounted; how he found Sobrinini at last on her island of snakes
and brought her back with him, only to be tantalized with imperfect
revelations that made it still necessary to hunt out Japazy on Jaguar
Island is told in the preceding volume of this series, entitled, “Bomba,
the Jungle Boy, at the Giant Cataract; or, Chief Nascanora and His
Captives.”
And now to return to Bomba as he writhed and struggled to shake
himself free from that terrible grip on his throat!
He knew that he was fighting for his life.
What was it that had waited for him with the stealth of the panther to
leap upon him as he passed?
That one of the headhunters of the tribe of Nascanora had him in his
grip, Bomba knew at the first touch of those fingers of steel about his
throat.
Few could break the grip of the jungle Indian. Only those bred as
Bomba had been among the very wild beasts of that tangled region
could have hoped to free himself of that strangle hold.
With a tremendous heave of his powerful young shoulders Bomba
flung himself upon his back, the Indian half over him. With frantic
fingers the lad tore at that clutch about his throat.
Above, the thunder rumbled dourly. Dim flashes of sheet lightning
served to deepen by contrast the darkness that enveloped the
antagonists.
Strain as he would the lad could not force that hold to break. His
head was reeling, his brain confused and black spots danced before
his glazing eyes.
A flash of lightning brighter than the rest showed him the Indian, on
whose face was an expression of fiendish gloating.
That look was a spur to Bomba’s failing senses. He thought of
Casson, left defenseless with Bomba dead, and by a mighty effort
raised himself and drove his knee with all his strength into the flesh
beneath the ribs of his antagonist.
The blow was a surprise to the Indian, who counted his adversary as
already beaten. He grunted with dismay and pain. For the fraction of
an instant his grip relaxed, and in that instant Bomba had burst the
iron ring about his throat and was on his feet.
With a bellow of rage the savage also sprang upright, whipping out a
short knife from his belt.
But quick as he was, Bomba was quicker. He saw the gleam of the
Indian’s steel, drew his own machete and with one stroke sent his
enemy’s weapon whizzing off into the underbrush.
Like a panther, the Indian sprang upon the white boy, and before
Bomba could strike home with the machete had seized upon the
lad’s hand, striving to bend it backward and possess himself of the
machete.
But if the Indian was strong, so was Bomba. He was fighting for two
lives, his own and Casson’s, and, moreover, one of his fierce rages
was upon him; one of those wild bursts of fury that for the moment
gave him the strength of the jaguar, the wile of the fox, the quickness
of the snake.
Bomba was all these in one now, as he fought with the Indian,
straining backward and forward, resisting the pressure upon his knife
arm, striving with all the power in him to drive downward the shining
point of his machete, to sink it to the hilt in his enemy’s flesh.
For some minutes the fierce struggle went on. Then, with a sudden
twist, Bomba broke the Indian’s hold, leaped backward several feet,
and threw his machete.
It would have found its mark had not the savage fallen forward with
the sudden releasing of Bomba’s pressure. The knife grazed his
head. Thrown off his balance, the savage tried to recover himself.
But the slime of mud and leaves made treacherous footing and the
Indian plunged headlong.
Bomba was upon him with the swiftness of a jaguar!
CHAPTER III
THE BLAZING CABIN

At such close quarters Bomba could not use his bow, and he dared
not fire the revolver lest it attract the attention of lurking foes.
Rising into the air, he came down with both feet on his enemy’s
head. Then he stamped the head into the mud and ooze till the
savage lay still.
Whether the man breathed or not, Bomba did not stop to inquire. It
was enough that he had been put out of action. The noise of the
struggle, muffled as it had been, might already be drawing others to
the scene. Bomba must act swiftly, if he were to leave the spot alive.
One of his precious minutes he gave to the search for his machete.
With its aid he might still win through to Casson at the hut of Pipina.
By a stroke of good fortune he found the weapon where it had stuck
in the trunk of a tree.
With a smothered cry of elation, Bomba leaped upon it and
wrenched it from its hold. Again and again that knife had saved his
life, and it might do it again before the night was over.
Bomba’s body was bruised, he was dead tired, but his spirit was
unhurt. The thirst of battle was still in him. His blood was hot with it.
Twice to-night he had outwitted his enemies. Nascanora and his half-
brother Tocarora would again realize that he, Bomba, was as
slippery as the cooanaradi and as deadly.
He wasted no time. He set his feet in the direction of the cabin of
Pipina, the squaw, and went stealthily yet swiftly through the jungle.
The storm had felled great trees across his path. Some of these he
climbed over, while he took the smaller ones with a leap. Where the
ground was impassable he swung himself along from creeper to
creeper and branch to branch. No inhabitant of the jungle save the
monkeys were as skilled in this method of progress as Bomba, and
he made his way with amazing celerity. Never had that
accomplishment stood him in better stead.
His eyes and ears were alert for the slightest sight or sound that
might forebode danger. But this did not prevent his mind from being
in a tumult of varied emotions.
His most anxious thought was of Casson, Casson alone in the jungle
hut save for Pipina. Again the headhunters sought the life of Casson.
Again was Bomba hunted like the veriest wild beast.
Bitterness welled up in the heart of the lad against these savages,
whom he had never injured except in self-defense. Why was he
doomed to spend his life among these people so alien to him?
Bomba was white. All his yearnings were toward those of his own
race.
Who were his parents? He thought of the picture of the beautiful
woman that had hung in the little back room of Sobrinini’s hut on the
island of snakes. That face had stirred his heart as no other had ever
done. Was the beautiful woman his mother?
Who was he? What had happened to his parents and why had he
become at so early an age the sole companion of old Cody Casson?
He reviewed the strange behavior of the half-mad old woman,
Sobrinini, she who had once been the operatic idol of Europe, she
who had had kings at her feet. Why had she not finished the story of
the man named Bartow, his wife, Laura, and the child they called
Bonny?
Sobrinini had called him, Bomba, by the name of Bartow. She had
thought in her poor twisted mind that Bomba was Bartow. Was it
possible that Bomba was the boy who had once been called Bonny?
Bomba heaved a heavy sigh. Questions, questions always, and no
answers. Cody Casson had the key to the mystery. But poor Casson
must first find the key to that closed door in his mind beyond which
he could not go.
His mind in a whirl of unrest and longing, Bomba at last reached the
river which he must cross to reach the hut of Pipina.
The storm had now entirely died away. Only the heavy dripping of
moisture from the foliage betrayed its recent passage. The jungle
was still again with an unearthly stillness. The slight swish made by
Bomba as he swung himself from branch to branch was the only
sound that broke the silence.
Suddenly he paused and hung motionless, arms and legs entwined
about a bunch of creepers. His quick ear had caught a sound other
than the dripping of water on the sodden earth.
It was a slight sound, but Bomba knew at once what had caused it. It
was the faint dip of paddles in the water. The Indians were traveling
upstream. The headhunters of Nascanora were on their way to the
hut of Pipina to spread terror and death. Fortunate if death were all!
Far worse would be the tortures of any captives who might be
carried off alive to make a holiday for the savages who had been left
at home and who would revel in the screams of their victims.
Bomba had been carrying his machete between his teeth. Now he
dropped lightly to the ground, and, with the double-edged knife held
firmly in his grasp, ran swiftly toward the river.
Upon the banks of the stream he paused, listening. Still the dip, dip
of paddles coming upstream. So faint and stealthy was the sound
that it would have been inaudible to most ears other than those of
Bomba.
The lad wasted not an instant, but slipped from the steep bank until
he was waist deep in the sluggish water. The dense foliage of the
jungle trees grew down to the very edge of the stream, flinging its
rank growth out over the water.
Bomba had a canoe of his own concealed in the bushes some
distance up the stream. Had there been time, he would have made
for that, for he well knew the danger of making the river crossing by
fording or swimming. The deadly alligator, or cayman, infested all the
waters of the jungle, and any daring person that ventured to cross
knew that he might pay for the venture with his life.
But time was everything to Bomba now. The headhunters were more
to be feared than the cayman. The former were awake. The latter
might be asleep. At all costs, he must make the venture. He must
make haste, if he were to save the life of Casson and that of Pipina.
Bomba had let himself go so gently into the water as scarcely to
make a ripple, and he moved on noiselessly, wading where he could,
but soon reaching the deeper channel where he had to swim. Then
most of the time he swam under water lest his presence be declared
to prying eyes. He was almost as much at home in the water as on
land, and only at long intervals had to come to the surface for air.
But swiftly as he swam, the Indians could paddle more swiftly. And a
terrible fear gripped the lad’s heart as the sound of the paddles grew
ever fainter in the distance.
They would reach the hut first. They would find it undefended and
might attack at once. The worst might have happened before Bomba
could reach the only place he called home.
What he would do when he got there he had not figured out. He
would act as the occasion suggested. He would be but one against
many; but he had been in that position more than once and yet won
the victory.
He swam on swiftly until he was arrested by a sight that brought a
growl of fury to his lips.
Turning a bend in the river, a light assailed Bomba’s eyes, a fearful
light, a light such as the native of the jungle dreads above all others.
It was a dull glow, brightening now and then to a vivid red as the
flames swept skyward.
Bomba groaned and his teeth gritted against each other as he
plunged madly forward. For he knew all too well what had caused
the glare. The hut of Pipina was ablaze!
This was the work of Nascanora’s bucks, their revenge upon a
broken, demented old man who had never harmed any one in his
life!
Was Casson in that blazing hut? Was poor Pipina, faithful friend,
caught in that flaming inferno?
Scarcely daring to put these questions to himself, Bomba swam
madly upstream, his one thought now of revenge. He was consumed
by rage. His one desire was to feel the throat of Nascanora beneath
his fingers.
The light was brighter now. The whole jungle was bathed in the
fiendish glow.
Bomba turned toward the bank, but paused abruptly and trod water.
Between him and the shore, blocking his path, was a monster
alligator!
CHAPTER IV
TERRIBLE JAWS

At sight of the cayman, Bomba’s heart for a moment seemed to stop


beating.
A wild hope that perhaps the brute was asleep and would not
perceive his presence was quickly dispelled as the lad caught sight
of two fiery eyes fixed upon him. Then the huge mouth opened,
displaying the horrible array of teeth that, if they once closed on the
lad, would bite him in half as easily as a pair of shears would snip a
thread.
Despairingly, Bomba felt for his machete. He knew that it would avail
little except perhaps to wound. It would simply help him to die
fighting.
Then his heart leaped. His feet felt the river bed beneath them! He
had reached the shallower part of the stream! Now he would have a
footing, something that would give him a purchase and enable him to
use his bow and arrows.
Quick as lightning, he unslung the bow from his shoulder and drew
an arrow from its quiver. With one motion he fitted the arrow to the
string and let fly.
The light from the fire gave him what he needed for his aim, and the
arrow entered the eye of the monster and penetrated to the brain.
With a fearful bellow of rage and pain, the great brute leaped half out
of the water and fell back, only to churn the water into a seething
whirlpool. In its wild flounderings the end of its serrated tail caught
Bomba on one of his legs and threw him farther out into the stream.
Bomba did not mind the blow, so full of exultation was he at the
mortal wound he had inflicted on his enemy. But his elation changed
to fear when he saw the scaly back of another alligator breaking the
water. The brute had been attracted by the uproar created by its
stricken comrade and was coming swiftly.
Luckily, the bank was not far away, and, putting all his power into his
strokes, the boy swam as he had never swum before. He reached
the shore not a moment too soon, for the hideous jaws snapped
close behind him as he pulled himself up the bank.
The impulse was strong on Bomba to shoot another arrow at the
reptile and send it to join its companion. But arrows were precious
now, and all he had would perhaps be needed for human foes.
So he repressed the impulse and hurried along the bank until he had
come near the fringe of trees that bordered the clearing in which
stood the hut. He could not yet see the hut itself. But to reach it he
would have to make a dash across the clearing.
In the dark he could have eluded the eyes of his enemies, for no
snake could move more silently. But now the open space was
flooded with light. No figures were visible, but he knew that many
eyes were watching from the surrounding woods.
Still he must chance it. He had faced death too often to let it daunt
him now.
Summoning all his strength, he darted out into the open. His first few
bounds carried him fifty feet. Then he dropped to the ground as a
dozen arrows whizzed over his head.
It was upon this that Bomba had counted. He had timed his drop for
just the instant that would allow the startled savages to aim and let
fly.
He was up again on his feet, and before arrows could again be fitted
to strings had gained another fifty feet. Again he repeated his
stratagem, but this time not without scathe, for an arrow grazed his
ankle.
“The arrow may be poisoned,” he thought to himself, as he felt the
twinge of pain. “If it is, this is the end of Bomba.”
He reached the shelter of a tree and whirled behind it. On the side of
the clearing he had just left, one of the headhunters, keen after his
prey, had come from behind his shelter.
Like lightning, Bomba fitted an arrow to his string. There was a
twang, a hideous yell, and the savage threw up his hands and fell
headlong.
“There will be one less to fight Bomba,” muttered the lad. “They will
find that Bomba can shoot.”
If any had been inclined to follow the fallen Indian, they had
hesitated when they had seen him drop, and Bomba had a moment’s
breathing space. He flew from behind the tree and, availing himself
of what shelter he could find in his flight, came in sight of what had
been his home.
His heart sank within him. The cabin was a mass of flames. It was
impossible for life to be sustained in that furnace for a minute. If
Casson and Pipina had been trapped there, they were already far
beyond human help. They must be just what the hut itself would be
in a few minutes more, a heap of smoldering ashes.
For a moment Bomba forgot everything save the agony that clutched
at his heart. Then a sound brought him back to the danger that
menaced him personally.
Out from the shelter of the trees, crouched almost double, their
horrible faces illumined by the lurid light of the flames, came a
number of the headhunters.
They approached in a semicircle, cutting off Bomba’s retreat toward
the front and on either side. Back of him was the blazing hut, the
heat from which was already scorching his face and hands.
Bomba felt that he was trapped. His doom seemed sealed. He felt
for the handle of the machete at his belt. He grasped his bow. He
would not allow himself to be taken alive. Better instant death than
the tortures of Nascanora. And he vowed that he would take more
than one of his enemies with him.
He bent his bow, took quick aim and fired. A bronze-skinned buck
clapped a hand to his breast, gave a frightful howl, and fell writhing
in the dust.
But before Bomba could fit another arrow to his string there was a
concerted rush and a dozen hands reached out to seize him.
Bomba leaped back quickly and drew his machete. His eyes blazed,
his muscles tensed.
The Indians yelled and leaped forward.
Bang!
A sharp detonation clashed against their eardrums like a crash of
thunder. The force of the explosion shook the earth and flung the
natives to the ground.
Bomba found himself on his face, half-stunned, bewildered.
Mysterious missiles hurtled over his head, exploding in mid-air.
He raised himself cautiously to his knees and saw a sight that
brought hope to his heart.
The Indians were in full retreat, and as they fled they looked over
their shoulders at him fearfully, as though they blamed him for their
discomfiture.
Bomba well knew the mind of the Indian. The cause of the explosion
and the trembling of the earth were unknown to them. So they
reasoned that it must be a spell thrown over them by Bomba, friend
of the old witch doctor, Casson, to destroy them and save himself.
The Indians stopped in their mad flight at the edge of the jungle and
looked back. One of them, more daring than the rest, raised his bow
and took aim.
But before he could release the string one of the flying missiles
struck the would-be slayer, hurling him to the ground.
This was too much. The savages turned terror-stricken and fled from
that scene of mysterious death.
By this time Bomba had realized what must have caused the
explosion. Their little store of powder, so carefully guarded by
Casson and himself, had gone off when reached by the hot breath of
the fire. The flying missiles were the last of the cartridges belonging
to his revolver, that wonderful gift of Gillis and Dorn, the white rubber
hunters.
Bruised and shaken, Bomba staggered to his feet, hardly able to
believe his good fortune.
But as he turned back toward the cabin a great wave of desolation
flooded his heart.
There lay the cabin, now a heap of ashes. Were the ashes of
Casson and Pipina also there? Had those faithful ones come there to
their death?
With a sob Bomba threw himself on the ground and abandoned
himself to uncontrolled grief.
This, however, was of short duration. A wild rage welled up in his
heart, rage against the wicked Nascanora and his cruel tribe.
“They shall pay!” the lad cried, leaping to his feet. “For every drop of
Casson’s blood they shall pay! There will yet be wailing in the huts of
Nascanora. It is I, Bomba, who swear it!”
He paused, head upflung, listening.
What was that sound?
CHAPTER V
HOW THE INDIANS CAME

Bomba strained his ears and again heard the thing that had startled
him. It was a faint cry, rising and falling like a wail somewhere in the
bushes.
“Help!” came the voice, eerie as that of a banshee in the darkness.
“Help, Bomba! Help!”
Into Bomba’s heart sprang a great joy. This was the voice of Pipina,
the squaw—the voice that he had never expected to hear again. And
where Pipina was, must be Casson!
He was off like a deer in the direction from which the cry had come.
“Bomba hears you,” he called softly. “Bomba is coming.”
“Help!” came the feeble voice again. “Pipina is caught and cannot
get loose. Come quickly.”
Bomba wondered why he did not hear Casson’s voice, if Casson still
lived. But he said nothing and hurried on, hacking a passage through
the undergrowth.
He came nearer and nearer to the wailing woman until, pushing
aside a tangle of vines, he saw her. The moon, following close on the
heels of the tropical storm, was now riding high in the heavens and
shedding a soft luster over the jungle. By its light, Bomba caught
sight of Pipina as she stood holding out helpless hands to him.
She had been caught in a thorn thicket that had cruelly scratched her
hands and arms as she had struggled to free herself. Her wrinkled
face was drawn with pain.
By the deft use of his machete Bomba cleared away the clutching
branches and released her. The old squaw staggered dizzily, and the
lad put this arms about her shoulders to support her.
“Casson!” muttered Bomba hoarsely. “Tell me, Pipina! Tell me quick!
Where is Casson?”
The old woman drooped her head and stood there like a bowed
statue of grief, but said nothing until Bomba, mad with anxiety, shook
her gently by the shoulders.
“Do you hear, Pipina? Where is the good white man, Cody Casson,
my friend?”
Then the old woman raised her hands above her head and gave
vent to a wailing, desolate cry.
“Pipina no can tell. Casson her friend, too, good friend. He is gone.”
Bomba’s face darkened and again his heart contracted under the
cold hand of anguish.
“Tell me, Pipina,” he commanded. “Where has he gone? What has
become of him?”
“We sit down and I will tell you,” returned the squaw. “Pipina weak,
sick—”
For answer, Bomba cleared a space and, taking the old woman,
placed her as comfortably as he could with her back resting against
a giant tree.
He sat down opposite her, his arms folded, his glance full upon her
face.
“Now, Pipina, tell Bomba all,” he urged.
The old woman looked about her and shuddered. She wrapped her
skinny arms about her as though they were a garment and had
power to ward off the chill of the night.
“Headhunters—they gone?” she asked fearfully.
“Gone,” said Bomba tersely. “Where is Casson?”
“Bomba make them go away all by himself,” continued the squaw
admiringly. “Bomba great man some day—”
Bomba bent toward her.
“Do not talk foolishly, Pipina. Bomba not care about himself. Pipina
tell about Casson.”
The old woman gave her wailing cry and rocked herself back and
forth drearily.
“We have bad time, Casson, Pipina,” she said. “We all alone in hut,
wishing Bomba come. Storm come, but not Bomba. Thunder like
roar of pumas, many pumas.”
“Bomba caught in storm,” explained the lad. “No could come till
storm stopped.”
“Pipina listen for sound of Bomba’s feet,” went on the squaw. “Pipina
afraid. She think danger near. Wish Bomba would come quick.”
She said this, leaning forward, in a quick, hissing whisper. Now she
relaxed against the tree and stared gloomily into the heavy shadows
of the jungle.
“Casson not too good,” she muttered. “Pipina worry about Casson.
Worry hard.”
“What was wrong with Casson?” cried Bomba, exasperated beyond
measure by the slowness with which Pipina got on with her story.
“He very sick,” returned the squaw. “He not right.” She touched her
forehead significantly. “He walk back and forth, back and forth, and
talk to himself. He say: ‘Laura, Laura, dear sweet Laura. Must tell
Bomba. Bartow and Laura and little boy—’”
Bomba caught the arm of the old woman in an eager grip.
“Go on,” he commended. “What else did Casson say? Tell Bomba.”
But Pipina shook her head.
“He not say more,” she said. “Only those words he say again and
again. Then he stop, listen at door of hut, listen and then walk up
and down, up and down.”
“Go on,” cried Bomba.
“Then we hear things. We think you come. We happy. We sing. We
dance. But no, Bomba not come. It is the headhunters that come to
try to kill Casson and Pipina—”
Bomba gave a low growl like that of an animal and ground his teeth
together.
“They come.” The voice of the old woman rose again in eerie wailing.
“Casson, Pipina, we close door, push bolt, as Bomba tell us. We
heap things against door. Casson he take down old gun, but it not
work. He put fire stick through hole in hut. He think frighten bucks of
Nascanora.”
Bomba groaned as he saw the picture of old Cody Casson, brave to
the last, defying death, his only weapon a “fire stick” that would not
work.
“It happen quick,” went on Pipina with a helpless shake of her head.
“One, two, three—like that,” with a snap of her bony fingers. “The
headhunters come. They have heads, fresh heads, women, children
heads, on string at waists. They want more heads, Casson’s head,
Pipina’s head. They beat on door. They say: ‘Open. No hurt.
Nascanora friend of Casson.’”
Again came that growl as of an angry jaguar from the clenched teeth
of Bomba.
“Forked tongues! Black hearts!” he snarled. The woman nodded.
“Casson no open door,” she resumed. “He know Nascanora. He say
things. Make big chief mad. He beat more hard on door. He shout:
‘Casson witch doctor. He put a spell on sick people of our tribe.
Nascanora burn Casson and hut of Casson with him.’”
A smoldering fire was in Bomba’s eyes that boded no good to the
chief of the headhunters.
“Then Nascanora bring fire to the hut of Pipina,” went on the squaw.
“His bucks come with heaps of vines and leaves. They wet and not
burn at first. But after they burn, burn hot, and the hut of Pipina begin
to burn too.”
“But you got away, Pipina!” burst in Bomba eagerly. “You got away
from the headhunters and the fire. That was good. But how did you
do it? Tell Bomba. Do not make much words.”
The old woman shrugged her shoulders and there was a touch of
pride in her tone as she replied:
“Beneath the hut of Pipina there is a hole, and this hole it lead under
the ground out into the jungle.”
Bomba stared at her.
“A hole!” he exclaimed. “A passage! Why you not tell Bomba?”
The squaw smiled inscrutably.
“None know but Pipina.”
Bomba was listening with the most intense interest and wonder.
“Go on,” he cried, as Pipina paused.
“Pipina take up board in floor of hut,” went on the old woman. “Then
get down and crawl through hole. Casson come too. Long time to
creep through hole. Then come to end. Out into jungle where wet
and cool.”
“Then Casson got out safely?” cried Bomba.
The squaw nodded, and Bomba gratefully took her old wrinkled hand
in his.
“Pipina has saved the life of Casson,” the lad said gravely. “For this
Bomba thanks Pipina. He will never forget.”
The old woman threw her hands above her head, rocking herself
back and forth.
“Ayah, ayah!” she wailed. “Pipina save the life of Casson, but she
lose him after. For when Pipina look around Casson is gone!”

You might also like