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

Programming and Problem Solving with Python Ashok Namdev Kamthane - The ebook is available for instant download, read anywhere

The document promotes the book 'Programming and Problem Solving with Python' by Ashok Namdev Kamthane and Amit Ashok Kamthane, aimed at engineering students to learn Python as a tool for mathematical problem solving. It outlines the book's structure, which includes fundamentals of programming and object-oriented concepts, and emphasizes Python's simplicity and versatility across various engineering domains. Additionally, it provides links to download the book and other related educational resources.

Uploaded by

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

Programming and Problem Solving with Python Ashok Namdev Kamthane - The ebook is available for instant download, read anywhere

The document promotes the book 'Programming and Problem Solving with Python' by Ashok Namdev Kamthane and Amit Ashok Kamthane, aimed at engineering students to learn Python as a tool for mathematical problem solving. It outlines the book's structure, which includes fundamentals of programming and object-oriented concepts, and emphasizes Python's simplicity and versatility across various engineering domains. Additionally, it provides links to download the book and other related educational resources.

Uploaded by

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

Visit ebookmass.

com to download the full version and


explore more ebook or textbook

Programming and Problem Solving with Python Ashok


Namdev Kamthane

_____ Click the link below to download _____


https://ebookmass.com/product/programming-and-problem-
solving-with-python-ashok-namdev-kamthane/

Explore and download more ebook or textbook at ebookmass.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Problem Solving and Python Programming E. Balagurusamy

https://ebookmass.com/product/problem-solving-and-python-programming-
e-balagurusamy/

Python Programming: Using Problem Solving Approach 1st


Edition Reema Thareja

https://ebookmass.com/product/python-programming-using-problem-
solving-approach-1st-edition-reema-thareja/

Programming for Problem Solving E Balagurusamy

https://ebookmass.com/product/programming-for-problem-solving-e-
balagurusamy/

Introduction to Programming with Java: A Problem Solving


Approach 3rd Edition John Dean

https://ebookmass.com/product/introduction-to-programming-with-java-a-
problem-solving-approach-3rd-edition-john-dean/
Introduction To Computing And Problem Solving Using Python
1st Edition E. Balaguruswamy

https://ebookmass.com/product/introduction-to-computing-and-problem-
solving-using-python-1st-edition-e-balaguruswamy/

MATLAB: A Practical Introduction to Programming and


Problem Solving 4th Edition Stormy Attaway

https://ebookmass.com/product/matlab-a-practical-introduction-to-
programming-and-problem-solving-4th-edition-stormy-attaway/

Learning Scientific Programming with Python Hill

https://ebookmass.com/product/learning-scientific-programming-with-
python-hill/

Mastering Functional Programming with Python Brett


Neutreon

https://ebookmass.com/product/mastering-functional-programming-with-
python-brett-neutreon/

Python Programming and SQL: 10 Books in 1 - Supercharge


Your Career with Python Programming and SQL Andrew Reed

https://ebookmass.com/product/python-programming-and-sql-10-books-
in-1-supercharge-your-career-with-python-programming-and-sql-andrew-
reed/
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://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
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
Contents

About the Authors ii


Preface vii
Visual Walkthrough x
Acknowledgements xiii
1. Introduction to Computer and Python Programming 1
Learning Outcomes 1
Chapter Outline 1
1.1 Introduction 1
1.2 What is a Computer? 2
1.2.1 Input/Output (I/O) Unit 2
1.2.2 Central Processing Unit (CPU) 2
1.2.3 Memory Unit 2
1.3 Overview of Programming Languages 3
1.3.1 Machine Language 3
1.3.2 Assembly Language 3
1.3.3 High-level Language 4
1.4 History of Python 5
1.4.1 Why Python? 5
1.4.2 Installing Python in Windows 6
1.4.3 Starting Python in Different Execution Modes 9
1.5 Installing Python in Ubuntu 14
1.6 Executing Python Programs 15
1.6.1 Writing the First Python Program in Script Mode 16
1.7 Commenting in Python 18
1.8 Internal Working of Python 19
1.9 Python Implementations 19
1.9.1 Jython 20
1.9.2 IronPython 20
xvi Contents

1.9.3 Stackless Python 20


1.9.4 PyPy 20
Summary 20
Key Terms 21
Review Questions 21
A. Multiple Choice Questions 21
B. True or False 22
C. Exercise Questions 22
D. Programming Assignments 22
2. Basics of Python Programming 23
Chapter Outline 23
Learning Outcomes 23
2.1 Introduction 24
2.2 Python Character Set 24
2.3 Token 24
2.3.1 Literal 25
2.3.2 Value and Type on Literals 25
2.3.3 Keywords 26
2.3.4 Operator 26
2.3.5 Delimiter 26
2.3.6 Identifier/Variable 26
2.4 Python Core Data Type 27
2.4.1 Integer 27
2.4.2 Floating Point Number 29
2.4.3 Complex Number 29
2.4.4 Boolean Type 30
2.4.5 String Type 30
2.5 The print() Function 31
2.5.1 The print()Function with end Argument 33
2.6 Assigning Value to a Variable 34
2.6.1 More on Assigning Values to Variables 34
2.6.2 Scope of a Variable 35
2.7 Multiple Assignments 35
2.8 Writing Simple Programs in Python 37
2.9 The input() Function 38
2.9.1 Reading String from the Console 38
2.10 The eval() Function 41
2.10.1 Apply eval() to input() Function 42
2.11 Formatting Number and Strings 43
2.11.1 Formatting Floating Point Numbers 44
2.11.2 Justifying Format 45
2.11.3 Integer Formatting 45
Contents xvii

2.11.4 Formatting String 46


2.11.5 Formatting as a Percentage 46
2.11.6 Formatting Scientific Notation 47
2.12 Python Inbuilt Functions 47
2.12.1 The ord and chr Functions 50
Summary 51
Key Terms 51
Review Questions 52
A. Multiple Choice Questions 52
B. True or False 53
C. Exercise Questions 53
D. Programming Assignments 54
3. Operators and Expressions 55
Chapter Outline 55
Learning Outcomes 55
3.1 Introduction 55
3.2 Operators and Expressions 56
3.3 Arithmetic Operators 56
3.3.1 Unary Operators 56
3.3.2 Binary Operators 57
3.4 Operator Precedence and Associativity 66
3.4.1 Example of Operator Precedence 67
3.4.2 Associativity 67
3.5 Changing Precedence and Associativity
of Arithmetic Operators 68
3.6 Translating Mathematical Formulae into Equivalent Python Expressions 70
3.7 Bitwise Operator 71
3.7.1 The Bitwise AND (&) Operator 72
3.7.2 The Bitwise OR (|) Operator 73
3.7.3 The Bitwise XOR (^) Operator 74
3.7.4 The Right Shift (>>) Operator 76
3.7.5 The Left Shift (<<) Operator 77
3.8 The Compound Assignment Operator 78
Mini Project: Goods Service Tax (GST) Calculator 79
Summary 81
Key Terms 81
Review Questions 81
A. Multiple Choice Questions 81
B. True or False 82
C. Exercise Questions 83
D. Programming Assignments 85
xviii Contents

4. Decision Statements 86
Chapter Outline 86
Learning Outcomes 86
4.1 Introduction 86
4.2 Boolean Type 87
4.3 Boolean Operators 88
4.3.1 The not Operator 88
4.3.2 The and Operator 88
4.3.3 The or Operator 89
4.4 Using Numbers with Boolean Operators 89
4.5 Using String with Boolean Operators 90
4.6 Boolean Expressions and Relational Operators 90
4.7 Decision Making Statements 92
4.7.1 The if Statements 92
4.7.2 The if-else Statement 94
4.7.3 Nested if Statements 98
4.7.4 Multi-way if-elif-else Statements 99
4.8 Conditional Expressions 103
Mini Project: Finding the Number of Days in a Month 105
Summary 106
Key Terms 107
Review Questions 107
A. Multiple Choice Questions 107
B. True or False 109
C. Exercise Questions 110
D. Programming Assignments 110
5. Loop Control Statements 111
Chapter Outline 111
Learning Outcomes 111
5.1 Introduction 111
5.2 The while Loop 112
5.2.1 Details of while Loop 112
5.2.2 Flowchart for while Loop 113
5.2.3 Some More Programs on while Loop 115
5.3 The range() Function 117
5.3.1 Examples of range() Function 117
5.4 The for Loop 118
5.4.1 Details of for Loop 118
5.4.2 Some More Programs on for Loop 119
5.5 Nested Loops 123
5.5.1 Some More Programs on Nested Loops 124
5.6 The break Statement 127
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Other documents randomly have
different content
The Project Gutenberg eBook of Zuñi Folk
Tales
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

Title: Zuñi Folk Tales

Author: Frank Hamilton Cushing

Author of introduction, etc.: John Wesley Powell

Release date: May 8, 2017 [eBook #54682]


Most recently updated: October 23, 2024

Language: English

Credits: E-text prepared by Larry B. Harrison, Sam W., and the


Online Distributed Proofreading Team
(http://www.pgdp.net) from page images generously
made available by Internet Archive
(https://archive.org)

*** START OF THE PROJECT GUTENBERG EBOOK ZUÑI FOLK TALES


***
The Project Gutenberg eBook, Zuñi Folk Tales, by Frank Hamilton
Cushing

Note: Images of the original pages are available through Internet


Archive. See
https://archive.org/details/zuifolktales00cushrich

ZUÑI FOLK TALES

RECORDED AND TRANSLATED BY

FRANK HAMILTON CUSHING

With an Introduction by

J. W. POWELL
TÉNATSA
LI

NEW YORK AND LONDON


G. P. PUTNAM’S SONS
The Knickerbocker Press
1901

Copyright, 1901
by
EMILY T. M. CUSHING
The Knickerbocker Press, New York
LIST OF TALES
PAGE
The Trial of Lovers: or the Maiden of Mátsaki and the Red Feather 1
The Youth and his Eagle 34
The Poor Turkey Girl 54
How the Summer Birds Came 65
The Serpent of the Sea 93
The Maiden of the Yellow Rocks 104
The Foster-child of the Deer 132
The Boy Hunter who never sacrificed to the Deer he had slain: or
the origin of the Society of Rattlesnakes 150
How Áhaiyúta and Mátsailéma stole the Thunder-stone and the
Lightning-shaft 175
The Warrior Suitor of Moki 185
How the Coyote joined the dance of the Burrowing-owls 203
The Coyote who killed the Demon Síuiuki: or why Coyotes run their
noses into deadfalls 215
How the Coyotes tried to steal the Children of the Sacred Dance 229
The Coyote and the Beetle 235
How the Coyote danced with the Blackbirds 237
How the Turtle out hunting duped the Coyote 243
The Coyote and the Locust 255
The Coyote and the Ravens who raced their eyes 262
The Prairie-dogs and their priest, the Burrowing-owl 269
How the Gopher raced with the runners of K’iákime 277
How the Rattlesnakes came to be what they are 285
How the Corn-pests were ensnared 288
Jack-rabbit and Cottontail 296
The Rabbit Huntress and her adventures 297
The Ugly Wild Boy who drove the Bear away from Southeastern
Mesa 310
The Revenge of the Two Brothers on the Háwikuhkwe, or the Two
Little Ones and their Turkeys 317
The Young Swift-runner who was stripped of his Clothing by the
Aged Tarantula 345
Átahsaia, the Cannibal Demon 365
The Hermit Mítsina 385
How the Twins of War and Chance, Áhaiyúta and Mátsailéma, fared
with the Unborn-made Men of the Underworld 398
The Cock and the Mouse 411
The Giant Cloud-swallower 423
The Maiden the Sun made love to, and her Boys: or the origin of
anger 429
LIST OF PLATES
PAGE
Portrait of Frank Hamilton Cushing Frontispiece
The Youth and his Eagle 34
Zuñi from the South 64
Waíhusiwa 92
A burro train in a Zuñi street 132
Thunder Mountain from Zuñi 174
A Hopi (Moki) maiden 184
A dance of the Kâkâ 228
Across the terraces of Zuñi 276
The pinnacles of Thunder Mountain 344
Pálowahtiwa 388
Zuñi Women carrying water 428
INTRODUCTION

I
T is instructive to compare superstition with science. Mythology is
the term used to designate the superstitions of the ancients.
Folk-lore is the term used to designate the superstitions of the
ignorant of today. Ancient mythology has been carefully studied by
modern thinkers for purposes of trope and simile in the
embellishment of literature, and especially of poetry; then it has
been investigated for the purpose of discovering its meaning in the
hope that some occult significance might be found, on the theory
that the wisdom of the ancients was far superior to that of modern
men. Now, science has entered this field of study to compare one
mythology with another, and pre-eminently to compare mythology
with science itself, for the purpose of discovering stages of human
opinion.
When the mythology of tribal men came to be studied, it was found
that their philosophy was also a mythology in which the mysteries of
the universe were explained in a collection of tales told by wise men,
prophets, and priests. This lore of the wise among savage men is of
the same origin and has the same significance as the lore of Hesiod
and Homer. It is thus a mythology in the early sense of that term.
But the mythology of tribal men is devoid of that glamour and
witchery born of poetry; hence it seems rude and savage in
comparison, for example, with the mythology of the Odyssey, and to
rank no higher as philosophic thought than the tales of the ignorant
and superstitious which are called folk-lore; and gradually such
mythology has come to be called folk-lore. Folk-lore is a discredited
mythology—a mythology once held as a philosophy. Nowadays the
tales of savage men, not being credited by civilized and enlightened
men with that wisdom which is held to belong to philosophy, are
called folk-lore, or sometimes folk-tales.
The folk-tales collected by Mr. Cushing constitute a charming exhibit
of the wisdom of the Zuñis as they believe, though it may be but a
charming exhibit of the follies of the Zuñis as we believe.
The wisdom of one age is the folly of the next, and the opinions of
tribal men seem childish to civilized men. Then why should we seek
to discover their thoughts? Science, in seeking to know the truth
about the universe, does not expect to find it in mythology or folk-
lore, does not even consider it as a paramount end that it should be
used as an embellishment of literature, though it serves this purpose
well. Modern science now considers it of profound importance to
know the course of the evolution of the humanities; that is, the
evolution of pleasures, the evolution of industries, the evolution of
institutions, the evolution of languages, and, finally, the evolution of
opinions. How opinions grow seems to be one of the most
instructive chapters in the science of psychology. Psychologists do
not go to the past to find valid opinions, but to find stages of
development in opinions; hence mythology or folk-lore is of profound
interest and supreme importance.
Under the scriptorial wand of Cushing the folk-tales of the Zuñis are
destined to become a part of the living literature of the world, for he
is a poet although he does not write in verse. Cushing can think as
myth-makers think, he can speak as prophets speak, he can
expound as priests expound, and his tales have the verisimilitude of
ancient lore; but his sympathy with the mythology of tribal men does
not veil the realities of science from his mind.
The gods of Zuñi, like those of all primitive people, are the ancients
of animals, but we must understand and heartily appreciate their
simple thought if we would do them justice. All entities are animals
—men, brutes, plants, stars, lands, waters, and rocks—and all have
souls. The souls are tenuous existences—mist entities, gaseous
creatures inhabiting firmer bodies of matter. They are ghosts that
own bodies. They can leave their bodies, or if they discover bodies
that have been vacated they can take possession of them. Force and
mind belong to souls; fixed form, firm existence belong to matter,
while bodies and souls constitute the world. The world is a universe
of animals. The stars are animals compelled to travel around the
world by magic. The plants are animals under a spell of
enchantment, so that usually they cannot travel. The waters are
animals sometimes under the spell of enchantment. Lakes writhe in
waves, the sea travels in circles about the earth, and the streams
run over the lands. Mountains and hills tremble in pain, but cannot
wander about; but rocks and hills and mountains sometimes travel
about by night.
These animals of the world come in a flood of generations, and the
first-born are gods and are usually called the ancients, or the first
ones; the later-born generations are descendants of the gods, but
alas, they are degenerate sons.
The theatre of the world is the theatre of necromancy, and the gods
are the primeval wonder-workers; the gods still live, but their
descendants often die. Death itself is the result of necromancy
practiced by bad men or angry gods.
In every Amerindian language there is a term to express this magical
power. Among the Iroquoian tribes it is called orenda; among the
Siouan tribe some manifestations of it are called wakan or wakanda,
but the generic term in this language is hube. Among the
Shoshonean tribes it is called pokunt. Let us borrow one of these
terms and call it “orenda.” All unexplained phenomena are attributed
to orenda. Thus the venom of the serpent is orenda, and this orenda
can pass from a serpent to an arrow by another exercise of orenda,
and hence the arrow is charmed. The rattlesnake may be stretched
beside the arrow, and an invocation may be performed that will
convey the orenda from the snake to the arrow, or the serpent may
be made into a witch’s stew and the arrow dipped into the brew.
No man has contributed more to our understanding of the doctrine
of orenda as believed and practised by the Amerindian tribes than
Cushing himself. In other publications he has elaborately discussed
this doctrine, and in his lectures he was wont to show how forms
and decorations of implements and utensils have orenda for their
motive.
When one of the ancients—that is, one of the gods—of the Iroquois
was planning the streams of earth by his orenda or magical power,
he determined to have them run up one side and down the other; if
he had done this men could float up or down at will, by passing from
one side to the other of the river, but his wicked brother interfered
and made them run down on both sides; so orenda may thwart
orenda.
The bird that sings is universally held by tribal men to be exercising
its orenda. And when human beings sing they also exercise orenda;
hence song is a universal accompaniment of Amerindian worship. All
their worship is thus fundamentally terpsichorean, for it is supposed
that they can be induced to grant favors by pleasing them.
All diseases and ailments of mankind are attributed by tribal men to
orenda, and all mythology is a theory of magic. Yet many of the
tribes, perhaps all of them, teach in their tales of some method of
introducing death and disease into the world, but it is a method by
which supernatural agencies can cause sickness and death.
The prophets, who are also priests, wonder-workers, and medicine-
men, are called shamans in scientific literature. In popular literature
and in frontier parlance they are usually called medicine-men.
Shamans are usually initiated into the guild, and frequently there are
elaborate tribal ceremonies for the purpose. Often individuals have
revelations and set up to prophesy, to expel diseases, and to teach
as priests. If they gain a following they may ultimately exert much
influence and be greatly revered, but if they fail they may gradually
be looked upon as wizards or witches, and they may be accused of
black art, and in extreme cases may be put to death. All Amerindians
believe in shamancraft and witchcraft.
The myths of cosmology are usually called creation myths.
Sometimes all myths which account for things, even the most trivial,
are called creation myths. Every striking phenomenon observed by
the Amerind has a myth designed to account for its origin. The horn
of the buffalo, the tawny patch on the shoulders of the rabbit, the
crest of the blue-jay, the tail of the magpie, the sheen of the
chameleon, the rattle of the snake,—in fact, everything that
challenges attention gives rise to a myth. Thus the folk-tales of the
Amerinds seem to be inexhaustible, for in every language, and there
are hundreds of them, a different set of myths is found.
In all of these languages a strange similarity in cosmology is
observed, in that it is a cosmology of regions or worlds. About the
home world of the tribe there is gathered a group of worlds, one
above, another below, and four more: one at every cardinal point; or
we may describe it as a central world, an upper world, a lower
world, a northern world, a southern world, an eastern world, and a
western world. All of the animals of the tribes, be they human
animals, tree animals, star animals, water animals (that is, bodies of
water), or stone animals (that is, mountains, hills, valleys, and
rocks), have an appropriate habitation in the zenith world, the nadir
world, or in one of the cardinal worlds, and their dwelling in the
center world is accounted for by some myth of travel to this world.
All bodies and all attributes of bodies have a home or proper place of
habitation; even the colors of the clouds and the rainbow and of all
other objects on earth are assigned to the six regions from which
they come to the midworld.
We may better understand this habit of thought by considering the
folk-lore of civilization. Here are but three regions: heaven, earth,
and hell. All good things come from heaven; and all bad things from
hell. It is true that this cosmology is not entertained by scholarly
people. An enlightened man thinks of moral good as a state of mind
in the individual, an attribute of his soul, and a moral evil as the
characteristic of an immoral man; but still it is practically universal
for even the most intelligent to affirm by a figure of speech that
heaven is the place of good, and hell the place of evil. Now, enlarge
this conception so as to assign a place as the proper region for all
bodies and attributes, and you will understand the cosmological
concepts of the Amerinds.
The primitive religion of every Amerindian tribe is an organized
system of inducing the ancients to take part in the affairs of men,
and the worship of the gods is a system designed to please the
gods, that they may be induced to act for men, particularly the tribe
of men who are the worshipers. Time would fail me to tell of the
multitude of activities in tribal life designed for this purpose, but a
few of them may be mentioned. The first and most important of all
are terpsichorean ceremonies and festivals. Singing and dancing are
universal, and festivals are given at appointed times and places by
every tribe. The long nights of winter are devoted largely to worship,
and a succession of festival days are established, to be held at
appropriate seasons for the worship of the gods. Thus there are
festival days for invoking rain, there are festival days for
thanksgiving—for harvest homes. In lands where the grasshopper is
an important food there are grasshopper festivals. In lands where
corn is an important food there are green-corn festivals; where the
buffalo constituted an important part of their aliment there were
buffalo dances. So there is a bear dance or festival, and elk dance or
festival, and a multitude of other festivals as we go from tribe to
tribe, all of which are fixed at times indicated by signs of the zodiac.
In the higher tribes elaborate calendars are devised from which we
unravel their picture-writings.
The practice of medicine by the shamans is an invocation to the
gods to drive out evil spirits from the sick and to frighten them that
they may leave. By music and dancing they obtain the help of the
ancients, and by a great variety of methods they drive out the evil
beings. Resort is often had to scarifying and searing, especially when
the sick man has great local pains. All American tribes entertain a
profound belief in the doctrine of signatures,—similia, similibus
curantur,—and they use this belief in procuring charms as medicine
to drive out the ghostly diseases that plague their sick folk.
Next in importance to terpsichorean worship is altar worship. The
altar is a space cleared upon the ground, or a platform raised from
the ground or floor of the kiva or assembly-house of the people.
Around the altar are gathered the priests and their acolytes, and
here they make prayers and perform ceremonies with the aid of
altar-pieces of various kinds, especially tablets of picture-writings on
wood, bone, or the skins of animals. The altar-pieces consist of
representatives of the thing for which supplication is made: ears of
corn or vases of meal, ewers of water, parts of animals designed for
food, cakes of grasshoppers, basins of honey, in fine any kind of
food; then crystals or fragments of rock to signify that they desire
the corn to be hard, or of honeydew that they desire the corn to be
sweet, or of corn of different colors that they desire the corn to be
of a variety of colors. That which is of great interest to students of
ethnology is the system of picture-writing exhibited on the altars. In
this a great variety of things which they desire and a great variety of
the characteristics of these things are represented in pictographs, or
modeled in clay, or carved from wood and bone. The graphic art, as
painting and sculpture, has its origin with tribal men in the
development of altar-pieces. So also the drama is derived from
primeval worship, as the modern practice of medicine has been
evolved from necromancy.
There is another method of worship found in savagery, but more
highly developed in barbarism,—the worship of sacrifice. The altar-
pieces and the dramatic supplications of the lower stage gradually
develop into a sacrificial stage in the higher culture. Then the
objects are supposed to supply the ancients themselves with food
and drink and the pleasures of life. This stage was most highly
developed in Mexico, especially by the Nahua or Aztec, where
human beings were sacrificed. In general, among the Amerinds, not
only are sacrifices made on the altar, but they are also made
whenever food or drink is used. Thus the first portions of objects
designed for consumption are dedicated to the gods. There are in
America many examples of these pagan religions, to a greater or
less extent affiliated in doctrine and in worship with the religion of
Christian origin.
In the early history of the association of white men with the Seneca
of New York and Pennsylvania, there was in the tribe a celebrated
shaman named Handsome Lake, as his Indian name is translated
into English. Handsome Lake had a nephew who was taken by the
Spaniards to Europe and educated as a priest. The nephew, on his
return to America, told many Bible stories to his uncle, for he
speedily relapsed into paganism. The uncle compounded some of
these Bible stories with Seneca folk-tales, and through his eloquence
and great influence as a shaman succeeded in establishing among
the Seneca a new cult of doctrine and worship. The Seneca are now
divided into two very distinct bodies who live together on the same
reservation,—the one are “Christians,” the other are “Pagans” who
believe and teach the cult of Handsome Lake.
Mr. Cushing has introduced a hybrid tale into his collection, entitled
“The Cock and the Mouse.” Such tales are found again and again
among the Amerinds. In a large majority of cases Bible stories are
compounded with native stories, so that unwary people have been
led to believe that the Amerinds are descendants of the lost tribes of
Israel.
J. W. Powell.
Washington City,
November, 1901.
ZUÑI FOLK TALES
THE TRIAL OF LOVERS:
OR THE MAIDEN OF MÁTSAKI AND THE RED
FEATHER

(Told the First Night)

I
N the days of the ancients, when Mátsaki was the home of the
children of men, there lived, in that town, which is called “Salt
City,” because the Goddess of Salt made a white lake there in the
days of the New, a beautiful maiden. She was passing beautiful, and
the daughter of the priest-chief, who owned more buckskins and
blankets than he could hang on his poles, and whose port-holes
were covered with turquoises and precious shells from the ocean—
so many were the sacrifices he made to the gods. His house was the
largest in Mátsaki, and his ladder-poles were tall and decorated with
slabs of carved wood—which you know was a great thing, for our
grandfathers cut with the tímush or flint knife, and even tilled their
corn-fields with wooden hoes sharpened with stone and weighted
with granite. That’s the reason why all the young men in the towns
round about were in love with the beautiful maiden of Salt City.
Now, there was one very fine young man who lived across the
western plains, in the Pueblo of the Winds. He was so filled with
thoughts of the maiden of Mátsaki that he labored long to gather
presents for her, and looked not with favor on any girl of his own
pueblo.
One morning he said to his fathers: “I have seen the maiden of
Mátsaki; what think ye?”
“Be it well,” said the old ones. So toward night the young man made
a bundle of mantles and necklaces, which he rolled up in the best
and whitest buckskin he had. When the sun was setting he started
toward Mátsaki, and just as the old man’s children had gathered in
to smoke and talk he reached the house of the maiden’s father and
climbed the ladder. He lifted the corner of the mat door and shouted
to the people below—“Shé!”
“Hai!” answered more than a pair of voices from below.
“Pull me down,” cried the young man, at the same time showing his
bundle through the sky-hole.
The maiden’s mother rose and helped the young man down the
ladder, and as he entered the fire-light he laid the bundle down.
“My fathers and mothers, my sisters and friends, how be ye these
many days?” said he, very carefully, as though he were speaking to
a council.
“Happy! Happy!” they all responded, and they said also: “Sit down;
sit down on this stool,” which they placed for him in the fire-light.
“My daughter,” remarked the old man, who was smoking his
cigarette by the opposite side of the hearth-place, “when a stranger
enters the house of a stranger, the girl should place before him food
and cooked things.” So the girl brought from the great vessel in the
corner fresh rolls of héwe, or bread of corn-flour, thin as papers, and
placed them in a tray before the young man, where the light would
fall on them.
“Eat!” said she, and he replied, “It is well.” Whereupon he sat up
very straight, and placing his left hand across his breast, very slowly
took a roll of the wafer bread with his right hand and ate ever so
little; for you know it is not well or polite to eat much when you go
to see a strange girl, especially if you want to ask her if she will let
you live in the same house with her. So the young man ate ever so
little, and said, “Thank you.”
“Eat more,” said the old ones; but when he replied that he was “past
the naming of want,” they said, “Have eaten,” and the girl carried
the tray away and swept away the crumbs.
“Well,” said the old man, after a short time, “when a stranger enters
the house of a stranger, it is not thinking of nothing that he enters.”
“Why, that is quite true,” said the youth, and then he waited.
“Then what may it be that thou hast come thinking of?” added the
old man.
“I have heard,” said the young man, “of your daughter, and have
seen her, and it was with thoughts of her that I came.”
Just then the grown-up sons of the old man, who had come to
smoke and chat, rose and said to one another: “Is it not about time
we should be going home? The stars must be all out.” Thus saying,
they bade the old ones to “wait happily until the morning,” and
shook hands with the young man who had come, and went to the
homes of their wives’ mothers.
“Listen, my child!” said the old man after they had gone away,
turning toward his daughter, who was sitting near the wall and
looking down at the beads on her belt fringe. “Listen! You have
heard what the young man has said. What think you?”
“Why! I know not; but what should I say but ‘Be it well,’” said the
girl, “if thus think my old ones?”
“As you may,” said the old man; and then he made a cigarette and
smoked with the young man. When he had thrown away his
cigarette he said to the mother: “Old one, is it not time to stretch
out?”
So when the old ones were asleep in the corner, the girl said to the
youth, but in a low voice: “Only possibly you love me. True, I have
said ‘Be it well’; but before I take your bundle and say ‘thanks,’ I
would that you, to prove that you verily love me, should go down
into my corn-field, among the lands of the priest-chief, by the side of
the river, and hoe all the corn in a single morning. If you will do this,
then shall I know you love me; then shall I take of your presents,
and happy we will be together.”
“Very well,” replied the young man; “I am willing.”
Then the young girl lighted a bundle of cedar splints and showed
him a room which contained a bed of soft robes and blankets, and,
placing her father’s hoe near the door, bade the young man “wait
happily unto the morning.”
So when she had gone he looked at the hoe and thought: “Ha! if
that be all, she shall see in the morning that I am a man.”
At the peep of day over the eastern mesa he roused himself, and,
shouldering the wooden hoe, ran down to the corn-fields; and when,
as the sun was coming out, the young girl awoke and looked down
from her house-top, “Aha!” thought she, “he is doing well, but my
children and I shall see how he gets on somewhat later. I doubt if he
loves me as much as he thinks he does.”
So she went into a closed room. Down in the corner stood a water
jar, beautifully painted and as bright as new. It looked like other
water jars, but it was not. It was wonderful, wonderful! for it was
covered with a stone lid which held down many may-flies and gnats
and mosquitoes. The maiden lifted the lid and began to speak to the
little animals as though she were praying.
“Now, then, my children, this day fly ye forth all, and in the corn-
fields by the river there shall ye see a young man hoeing. So hard is
he working that he is stripped as for a race. Go forth and seek him.”
“Tsu-nu-nu-nu,” said the flies, and “Tsi-ni-ni-ni,” sang the gnats and
mosquitoes; which meant “Yes,” you know.
“And,” further said the girl, “when ye find him, bite him, his body all
over, and eat ye freely of his blood; spare not his armpits, neither his
neck nor his eyelids, and fill his ears with humming.”
And again the flies said, “Tsu-nu-nu-nu,” and the mosquitoes and
gnats, “Tsi-ni-ni-ni.” Then, nu-u-u, away they all flew like a cloud of
sand on a windy morning.
“Blood!” exclaimed the young man. He wiped the sweat from his
face and said, “The gods be angry!” Then he dropped his hoe and
rubbed his shins with sand and slapped his sides. “Atu!” he yelled;
“what matters—what in the name of the Moon Mother matters with
these little beasts that cause thoughts?” Whereupon, crazed and
restless as a spider on hot ashes, he rolled in the dust, but to no
purpose, for the flies and gnats and mosquitoes sang “hu-n-n” and
“tsi-ni-ni” about his ears until he grabbed up his blanket and
breakfast, and ran toward the home of his fathers.
“Wa-ha ha! Ho o!” laughed a young man in the Tented Pueblo to the
north, when he heard how the lover had fared. “Shoom!” he
sneered. “Much of a man he must have been to give up the maid of
Mátsaki for may-flies and gnats and mosquitoes!” So on the very
next morning, he, too, said to his old ones: “What a fool that little
boy must have been. I will visit the maiden of Mátsaki. I’ll show the
people of Pínawa what a Hámpasawan man can do. Courage!”—and,
as the old ones said “Be it well,” he went as the other had gone; but,
pshaw! he fared no better.
After some time, a young man who lived in the River Town heard
about it and laughed as hard as the youth of the Tented Pueblo had.
He called the two others fools, and said that “girls were not in the
habit of asking much when one’s bundle was large.” And as he was a
young man who had everything, he made a bundle of presents as
large as he could carry; but it did him no good. He, too, ran away
from the may-flies and gnats and mosquitoes.
Many days passed before any one else would try again to woo the
maiden of Mátsaki. They did not know, it is true, that she was a
Passing Being; but others had failed all on account of mosquitoes
and may-flies and little black gnats, and had been more satisfied
with shame than a full hungry man with food. “That is sick
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookmass.com

You might also like