100% found this document useful (7 votes)
29 views

Test Bank for Building Python Programs Plus MyLab Programming with Pearson eText, Stuart Reges, Marty Stepp, Allison Obourn - Download All Chapters Immediately In PDF Format

The document provides links to various test banks and solution manuals for different subjects, including Python, Java, Auditing, and Nursing. It also includes programming exercises and sample solutions related to functions, conditional statements, and list processing. Additionally, it features a midterm exam with problems and their respective solutions.

Uploaded by

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

Test Bank for Building Python Programs Plus MyLab Programming with Pearson eText, Stuart Reges, Marty Stepp, Allison Obourn - Download All Chapters Immediately In PDF Format

The document provides links to various test banks and solution manuals for different subjects, including Python, Java, Auditing, and Nursing. It also includes programming exercises and sample solutions related to functions, conditional statements, and list processing. Additionally, it features a midterm exam with problems and their respective solutions.

Uploaded by

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

Download the full version and explore a variety of test banks

or solution manuals at https://testbankmall.com

Test Bank for Building Python Programs Plus MyLab


Programming with Pearson eText, Stuart Reges,
Marty Stepp, Allison Obourn

_____ Tap the link below to start your download _____

https://testbankmall.com/product/test-bank-for-building-
python-programs-plus-mylab-programming-with-pearson-etext-
stuart-reges-marty-stepp-allison-obourn/

Find test banks or solution manuals at testbankmall.com today!


We believe these products will be a great fit for you. Click
the link to download now, or visit testbankmall.com
to discover even more!

Test Bank for Building Java Programs 3/E 3rd Edition


Stuart Reges, Marty Stepp

https://testbankmall.com/product/test-bank-for-building-java-
programs-3-e-3rd-edition-stuart-reges-marty-stepp/

Test Bank for Auditing: The Art and Science of Assurance


Engagements, Fourteenth Canadian Edition Plus MyLab
Accounting with Pearson eText — Package, 14th Edition
https://testbankmall.com/product/test-bank-for-auditing-the-art-and-
science-of-assurance-engagements-fourteenth-canadian-edition-plus-
mylab-accounting-with-pearson-etext-package-14th-edition/

Solution Manual for Auditing: The Art and Science of


Assurance Engagements, Fourteenth Canadian Edition Plus
MyLab Accounting with Pearson eText — Package, 14th
Edition
https://testbankmall.com/product/solution-manual-for-auditing-the-art-
and-science-of-assurance-engagements-fourteenth-canadian-edition-plus-
mylab-accounting-with-pearson-etext-package-14th-edition/

Test Bank for Pharmacotherapeutics for Advanced Practice,


3rd Edition, Virginia Poole Arcangelo

https://testbankmall.com/product/test-bank-for-pharmacotherapeutics-
for-advanced-practice-3rd-edition-virginia-poole-arcangelo/
Test Bank for Nursing Leadership and Management for
Patient Safety and Quality Care 1st Edition

https://testbankmall.com/product/test-bank-for-nursing-leadership-and-
management-for-patient-safety-and-quality-care-1st-edition/

Solution Manual for Principles of Environmental Science


9th Edition Cunningham

https://testbankmall.com/product/solution-manual-for-principles-of-
environmental-science-9th-edition-cunningham/

Managerial Economics and Strategy 2nd Edition Perloff Test


Bank

https://testbankmall.com/product/managerial-economics-and-
strategy-2nd-edition-perloff-test-bank/

Test Bank for The Living World, 7th Edition: George


Johnson

https://testbankmall.com/product/test-bank-for-the-living-world-7th-
edition-george-johnson/

Test Bank for Mathematical Ideas 12th edition by Miller


(Copy)

https://testbankmall.com/product/test-bank-for-mathematical-
ideas-12th-edition-by-miller-copy/
Financial Reporting and Analysis 6th Edition Revsine Test
Bank

https://testbankmall.com/product/financial-reporting-and-analysis-6th-
edition-revsine-test-bank/
2. Parameter Mystery
At the bottom of the page, write the output produced by the following program.

def main():
x = "happy"
y = "pumpkin"
z = "orange"
pumpkin = "sleepy"
orange = "vampire"

orange(y, x, z)
orange(x, z, y)
orange(pumpkin, z, "y")
z = "green"
orange("x", "pumpkin", z)
orange(y, z, orange)

def orange(z, y, x):


print(y + " and " + z + " were " + x)

2 of 23
3. If/Else Simulation
For each call of the function below, write the value that is returned:

def mystery(n):
if (n < 0):
n = n * 3
return n
else:
n = n + 3
if (n % 2 == 1):
n = n + n % 10
return n

Function Call Value Returned

mystery(-5) _______________________________

mystery(0) _______________________________

mystery(7) _______________________________

mystery(18) _______________________________

mystery(49) _______________________________

3 of 23
4. Programming
Write a function named month_apart that accepts four integer parameters representing two calendar dates. Each
date consists of a month (1 through 12) and a day (1 through the number of days in that month [28-31]). Assume that
all dates occur during the same year. The method returns whether the dates are at least a month apart. For example,
the following dates are all considered to be at least a month apart from 9/19 (September 19): 2/14, 7/25, 8/2, 8/19,
10/19, 10/20, and 11/5. The following dates are NOT at least a month apart from 9/19: 9/20, 9/28, 10/1, 10/15,
and 10/18. Note that the first date could come before or after (or be the same as) the second date. Assume that all
parameter values passed are valid.

Sample calls:

month_apart( 6, 14, 9, 21) should return True, because June 14 is at least a month before September 21
month_apart( 4, 5, 5, 15) should return True, because April 5 is at least a month before May 15
month_apart( 4, 15, 5, 15) should return True, because April 15 is at least a month before May 15
month_apart( 4, 16, 5, 15) should return False, because April 16 isn't at least a month apart from May 15
month_apart( 6, 14, 6, 8) should return False, because June 14 isn't at least a month apart from June 8
month_apart( 7, 7, 6, 8) should return False, because July 7 isn't at least a month apart from June 8
month_apart( 7, 8, 6, 8) should return True, because July 8 is at least a month after June 8
month_apart(10, 14, 7, 15) should return True, because October 14 is at least a month after July 15

4 of 23
5. Programming
Write a function named print_grid that accepts two integer parameters rows and cols. The output is a comma-
separated grid of numbers where the first parameter (rows) represents the number of rows of the grid and the second
parameter (cols) represents the number of columns. The numbers count up from 1 to (rows x cols). The output are
displayed in column-major order, meaning that the numbers shown increase sequentially down each column and wrap
to the top of the next column to the right once the bottom of the current column is reached.

Assume that rows and cols are greater than 0. Here are some example calls to your function and their expected
results:

Call print_grid(3, 6) print_grid(5, 3) print_grid(4, 1) print_grid(1, 3)

Output 1, 4, 7, 10, 13, 16 1, 6, 11 1 1, 2, 3


2, 5, 8, 11, 14, 17 2, 7, 12 2
3, 6, 9, 12, 15, 18 3, 8, 13 3
4, 9, 14 4
5, 10, 15

5 of 23
6. Programming
Write a function named count_even_digits that accepts two integers as parameters and returns the number of
even-valued digits in the first number. An even-valued digit is either 0, 2, 4, 6, or 8. The second value represents how
many digits the number has. The second value is guaranteed to match the number of digits in the first number.

For example, the number 8546587 has four even digits (the two 8s, the 4, and the 6),
so the call count_even_digits(8346387, 7) should return 4.

You may assume that the values passed to your function are non-negative.

6 of 23
Midterm Exam 1, Sample 1 Solutions

1. Expressions
Expression Value
8 + 5 * 3 / 2 15.5
1.5 * 4 * 7 // 8 + 3.4 8.4
73 % 10 - 6 % 10 + 28 % 3 -2
4 + 1 + 9 + (-3 + 10) + 11 // 3 24
3 // 14 // 7 / (1.0 * 2) + 10 // 6 1.0
10 > 11 == 4 / 3 > 1 False
not (2 >= 11 or 10 < 67 or 4 / 4 >= 1) False
(True or not 2 < 3) and 6 == 4 / 3 False

2. Parameter Mystery
happy and pumpkin were orange
orange and happy were pumpkin
orange and sleepy were y
pumpkin and x were green
green and pumpkin were vampire

3. If/Else Simulation

Function Call Value Returned


mystery(-5) -15
mystery(0) 6
mystery(7) 10
mystery(18) 22
mystery(49) 52

4. Programming (four solutions shown)


def month_apart(m1, d1, m2, d2):
if (m1 == m2):
return False
elif (m1 <= m2 - 2):
return True
elif (m1 >= m2 + 2):
return True
elif (m1 == m2 - 1):
if (d1 <= d2):
return True
else:
return False
elif (m1 == m2 + 1):
if (d1 >= d2):
return True
else:
return False
else:
return False

def month_apart(m1, d1, m2, d2):


if (m1 < m2 - 1 or m1 > m2 + 1):
return True
elif (m1 == m2 - 1 and d1 <= d2):
return True
elif (m1 == m2 + 1 and d1 >= d2):
return True
else:
return False

7 of 23
def month_apart(m1, d1, m2, d2):
return (m2 - m1 > 1) or (m1 - m2 > 1) or
(m2 - m1 == 1 and d1 <= d2) or
(m1 - m2 == 1 and d1 >= d2)

def month_apart(m1, d1, m2, d2):


return abs((m1 * 31 + d1) - (m2 * 31 + d2)) >= 31

5. Programming (two solutions shown)


def print_grid(rows, cols):
for i in range(1, rows + 1):
print(i, end=’’)
for j in range(1, cols):
print(", " + str(i + rows * j), end=’’)
print()

def print_grid(rows, cols):


for i in range(1, rows + 1):
for for j in range(1, cols):
print(str(i + rows * j) + ", ", end=’’)
print(i + rows * (cols - 1))

6. Programming
def count_even_digits(n, length):
count = 0
for i in range(0,length):
digit = n % 10
n = n // 10
if (digit % 2 == 0):
count += 1

return count

Midterm 2 Sample 1
1. List Mystery
Consider the following function:

def list_mystery(list):
int x = 0
for i in range(0, len(list) - 1):
if (list[i] > list[i + 1]):
x += 1
return x

In the left-hand column below are specific lists of integers. Indicate in the right-hand column what value would be
returned by function list_mystery if the integer list in the left-hand column is passed as its parameter.

Original Contents of List Value Returned


a1 = [8]
result1 = list_mystery(a1) _____________________________

a2 = [14, 7]
result2 = list_mystery(a2) _____________________________

8 of 23
a3 = [7, 1, 3, 2, 0, 4]
result3 = list_mystery(a3) _____________________________

a4 = [10, 8, 9, 5, 6]
result4 = list_mystery(a4) _____________________________

a5 = [8, 10, 8, 6, 4, 2]
result5 = list_mystery(a5) _____________________________

9 of 23
2. Reference Semantics Mystery
The following program produces 4 lines of output. Write the output below, as it would appear on the console.

def main():
y = 1
x = 3
a = [0] * 4

mystery(a, y, x)
print(str(x) + " " + str(y) + " " + str(a))

x = y - 1
mystery(a, y, x)
print(str(x) + " " + str(y) + " " + str(a))

def mystery(a, x, y):


if (x < y):
x += 1
a[x] = 17
else:
a[y] = 17
print(str(x) + " " + str(y) + " " + str(a))

10 of 23
3. Assertions
For the following function, identify each of the three assertions in the table below as being either ALWAYS true,
NEVER true or SOMETIMES true / sometimes false at each labeled point in the code. You may abbreviate these
choices as A/N/S respectively.

def mystery():
y = 0
z = 1
next = input()

# Point A
while (next >= 0):
# Point B
if (y > z):
# Point C
z = y
y += 1
next = input()
# Point D

# Point E
return z

next < 0 y > z y == 0


Point A
Point B
Point C
Point D
Point E

11 of 23
4. File Processing
Write a function named word_stats that accepts as its parameter the name of a file that contains a sequence of
words and that reports the total number of words (as an integer) and the average word length (as an un-rounded real
number). For example, suppose file contains the following words:

To be or not to be, that is the question.

For the purposes of this problem, we will use whitespace to separate words. That means that some words include
punctuation, as in "be,". For the input above, your function should produce exactly the following output:

Total words = 10
Average length = 3.2

12 of 23
6. List Programming
Write a function named min_gap that accepts an integer list as a parameter and returns the minimum 'gap' between
adjacent values in the list. The gap between two adjacent values in a list is defined as the second value minus the first
value. For example, suppose a variable called list is a list of integers that stores the following sequence of values.

list = [1, 3, 6, 7, 12]

The first gap is 2 (3 - 1), the second gap is 3 (6 - 3), the third gap is 1 (7 - 6) and the fourth gap is 5 (12 - 7). Thus, the
call of min_gap(list) should return 1 because that is the smallest gap in the list. Notice that the minimum gap
could be a negative number. For example, if list stores the following sequence of values:

[3, 5, 11, 4, 8]

The gaps would be computed as 2 (5 - 3), 6 (11 - 5), -7 (4 - 11), and 4 (8 - 4). Of these values, -7 is the smallest, so it
would be returned.

This gap information can be helpful for determining other properties of the list. For example, if the minimum gap is
greater than or equal to 0, then you know the array is in sorted (nondecreasing) order. If the gap is greater than 0, then
you know the list is both sorted and unique (strictly increasing).

If you are passed an list with fewer than 2 elements, you should return 0.

13 of 23
6. Programming
Write a function named longest_sorted_equence that accepts a list of integers as a parameter and that returns the
length of the longest sorted (nondecreasing) sequence of integers in the list. For example, if a variable named list
stores the following values:

List = [3, 8, 10, 1, 9, 14, -3, 0, 14, 207, 56, 98, 12]

then the call of longest_sorted_sequence(list) should return 4 because the longest sorted sequence in the
array has four values in it (the sequence -3, 0, 14, 207). Notice that sorted means nondecreasing, which means that
the sequence could contain duplicates. For example, if the list stores the following values:

list2 = [17, 42, 3, 5, 5, 5, 8, 2, 4, 6, 1, 19]

Then the function would return 5 for the length of the longest sequence (the sequence 3, 5, 5, 5, 8). Your function
should return 0 if passed an empty list. Your function should return 1 if passed a list that is entirely in decreasing
order or contains only one element.

Midterm 2 Sample 1 Solutions


1.

Call Value Returned


a1 = [8]
result1 = list_mystery (a1) 0

a2 = [14, 7]
result2 = list_mystery (a2) 1

a3 = [7, 1, 3, 2, 0, 4]
result3 = list_mystery (a3) 3

a4 = [10, 8, 9, 5, 6]
result4 = list_mystery (a4) 2

a5 = [8, 10, 8, 6, 4, 2]
result5 = list_mystery (a5) 4

2.
2 3 [0, 0, 17, 0]
3 1 [0, 0, 17, 0]
1 0 [17, 0, 17, 0]
0 1 [17, 0, 17, 0]

3.
next < 0 y > z y == 0
Point A SOMETIMES NEVER ALWAYS
Point B NEVER SOMETIMES SOMETIMES

14 of 23
Point C NEVER ALWAYS NEVER
Point D SOMETIMES SOMETIMES NEVER
Point E ALWAYS SOMETIMES SOMETIMES

4.
def word_stats(file_name):
words = open(file_name).read().split()
count = 0
sum_length = 0

for word in words:


count += 1
sum_length += len(word)
average = sum_length / count
print("Total words = " + str(count))
print("Average length = " + str(average))

5.
def min_gap(list):
if (len(list) < 2):
return 0
else:
min = list[1] - list[0]
for i in range(2, len(list)):
gap = list[i] - list[i - 1]
if (gap < min):
min = gap
return min

6.
def longest_sorted_sequence(list):
if (len(list) == 0):
return 0

max = 1
count = 1
for i in range(1, len(list)):
if (list[i] >= list[i - 1]):
count += 1
else:
count = 1

if (count > max):


max = count
return max

15 of 23
Final Sample 1
1. While Loop Simulation
For each call of the function below, write the output that is printed:

def mystery(i, j):


while (i != 0 and j != 0):
i = i // j
j = (j - 1) // 2
print(str(i) + " " + str(j) + " ", end='')
print(i)

Function Call Output

mystery(5, 0) _______________________________

mystery(3, 2) _______________________________

mystery(16, 5) _______________________________

mystery(80, 9) _______________________________

mystery(1600, 40) _______________________________

16 of 23
2. Inheritance Mystery
Assume that the following classes have been defined:

class A(B): class C:


def method2(self): def __str__(self):
print("a 2 ", end='') return "c"
self.method1()
def method1(self):
class B(C): print("c 1 ", end='')
def __str__(se;f):
return "b" def method2(self):
print("c 2 ", end='')
def method2(self):
print("b 2 ", end='') class D(B):
super(B, seld).method2() def method1(self):
print("d 1 ", end='')
self.method2()

Given the classes above, what output is produced by the following code?

elements = [A(), B(), C(), D()]


for i in range(0, len(elements)):
print(elements[i])
elements[i].method1()
print()
elements[i].method2()
print()
print()

3. Collections Mystery
Consider the following method:
def mystery(data, pos, n):
result = set()
for i in range(0, n):
for j in range(0, n):
result.add(data[i + pos][j + pos])
return result

Suppose that a variable called grid has been declared as follows:


grid = [[8, 2, 7, 8, 2, 1], [1, 5, 1, 7, 4, 7],
[5, 9, 6, 7, 3, 2], [7, 8, 7, 7, 7, 9],
[4, 2, 6, 9, 2, 3], [2, 2, 8, 1, 1, 3]]
which means it will store the following 6-by-6 grid of values:
8 2 7 8 2 1
1 5 1 7 4 7
5 9 6 7 3 2
7 8 7 7 7 9
4 2 6 9 2 3
2 2 8 1 1 3
For each call below, indicate what value is returned. If the function call results in an error, write "error" instead.

Function Call Contents of Set Returned

mystery(grid, 2, 2) ___________________________________________________

mystery(grid, 0, 2) ___________________________________________________

17 of 23
mystery(grid, 3, 3) ___________________________________________________

4. List Programming
Write a function named is_unique that takes a list of integers as a parameter and that returns a boolean value indicating
whether or not the values in the list are unique (True for yes, False for no). The values in the list are considered
unique if there is no pair of values that are equal. For example, if a variable called list stores the following values:

list = [3, 8, 12, 2, 9, 17, 43, -8, 46, 203, 14, 97, 10, 4]

Then the call of is_unique(list) should return True because there are no duplicated values in this list.
If instead the list stored these values:

list = [4, 7, 2, 3, 9, 12, -47, -19, 308, 3, 74]

Then the call should return False because the value 3 appears twice in this list. Notice that given this definition, a list of
0 or 1 elements would be considered unique.

5. Dictionary/Set Programming

Write a function called count_in_area_code that accepts two parameters, a dictionary from names (strings)
to phone numbers (strings) and an area code (as a string), and returns how many unique phone numbers in the
map use that area code. For example, if a map m contains these pairs:
{Marty=206-685-2181, Rick=520-206-6126, Beekto=206-685-2181,
Jenny=253-867-5309, Stuart=206-685-9138, DirecTV=800-494-4388,
Bob=206-685-9138, Benson=206-616-1246, Hottline=900-520-2767}
The call of count_in_area_code(m, "206") should return 3, because there are 3 unique phone numbers
that use the 206 area code: Marty/Beekto's number of "206-685-2181", Stuart/Bob's number of "206-685-
9138", and Benson's number of "206-616-1246".

You may assume that every phone number value string in the dictionary will begin with a 3-digit numeric area
code, and that the area code string passed will be a numeric string exactly 3 characters in length. If the
dictionary is empty or contains no phone numbers with the given area code, your function should return 0.
You may create one collection (list, dictionary, set) of your choice as auxiliary storage to solve this problem.
You can have as many simple variables as you like. You should not modify the contents of the dictionary
passed to your function.

18 of 23
19 of 23
6. Programming
Write a function called same_pattern that returns true or false depending upon whether two strings have the same
pattern of characters. More precisely, two strings have the same pattern if they are of the same length and if two
characters in the first string are equal if and only if the characters in the corresponding positions in the second string
are also equal. Below are some examples of patterns that are the same and patterns that differ (keep in mind that the
method should return the same value no matter what order the two strings are passed).

1st String 2nd String Same Pattern?


------------ -------------- -------------
"" "" True
"a" "x" True
"a" "ab" False
"ab" "ab" True
"aa" "xy" False
"aba" "+-+" True
"---" "aba" False
"abcabc" "zodzod" True
"abcabd" "zodzoe" True
"abcabc" "xxxxxx" False
"aaassscccn" "aaabbbcccd" True
"asasasasas" "xyxyxyxyxy" True
"ascneencsa" "aeiouuoiea" True
"aaassscccn" "aaabbbcccd" True
"asasasasas" "xxxxxyyyyy" False
"ascneencsa" "aeiouaeiou" False
"aaassscccn" "xxxyyyzzzz" False
"aaasssiiii" "gggdddfffh" False

Your function should take two parameters: the two strings to compare. You are allowed to create new strings, but
otherwise you are not allowed to construct extra data structures to solve this problem (no list, set, dictionary, etc).
You are limited to the string functions on the cheat sheet.

7. 2-d Lists
Write a function called find_max that takes a two dimensional list as a parameter and returns the number of the row
that sums to the greatest value. For example if you had the following list of lists:
list = [[1, 2, 3], [2, 3, 3], [1, 3, 3]]
The first row would be 6, the second 8 and the third 7. The function would therefore return 1.
You can assume the passed in list of lists has at least one row and one column. You cannot assume that it is square.

8. Critters
Write a class Ostrich that extends the Critter class from the Critters assignment, including its get_move and
get_color methods. An Ostrich object first stays in the same place for 10 moves, then moves 10 steps to either the
WEST or the EAST, then repeats. In other words, after sitting still for 10 moves, the ostrich randomly picks to go west
or east, then walks 10 steps in that same direction. Then it stops and sits still for 10 moves and repeats. Whenever an
Ostrich is moving (that is, whenever its last call to get_move returned a direction other than DIRECTION_CENTER),
its color should be white ("white"). As soon as it stops moving, and initially when it first appears in the critter world,
its color should be cyan ("cyan"). When randomly choosing west vs. east, the two directions should be equally likely.

You may add anything needed (fields, other methods) to implement the above behavior appropriately. All other
critter behavior not discussed here uses the default values.

20 of 23
9. Classes and Objects

Suppose that you are provided with a pre-written class Date as # Each Date object stores a single
described at right. (The headings are shown, but not the method # month/day such as September 19.
# This class ignores leap years.
bodies, to save space.) Assume that the fields, constructor, and
methods shown are already implemented. You may refer to them class Date:
or use them in solving this problem if necessary. # Constructs a date with
# the given month and day.
Write an instance method named compare that will be placed inside def __init__(self, m, d):
the Date class to become a part of each Date object's behavior. self.__ month = m
The compare method accepts another Date as a parameter and self.__ day = d
compares the two dates to see which comes first in chronological
# Returns the date's day.
order. It returns an integer with one of the following values: def get_day(self)

• a negative integer (such as -1) if the date represented by # Returns the date's month.
this Date comes before that of the parameter def get_month(self)
• 0 if the two Date objects represent the same month and
# Returns the number of days
day # in this date's month.
• a positive integer (such as 1) if the date represented by def days_in_month(self)
this Date comes after that of the parameter
# Modifies this date's state
# so that it has moved forward
For example, if these Date objects are declared in client code:
# in time by 1 day, wrapping
# around into the next month
sep19 = Date(9, 19)
# or year if necessary.
dec15 = Date(12, 15)
# example: 9/19 -> 9/20
temp = Date(9, 19)
# example: 9/30 -> 10/1
sep11 = Date(9, 11)
# example: 12/31 -> 1/1
The following boolean expressions should have True results. def next_day()

sep19.compare(sep11) > 0
sep11.compare(sep19) < 0 # your method would go here
temp.compare(sep19) == 0
dec15.compare(sep11) > 0

Your method should not modify the state of either Date object (such
as by changing their day or month field values).

Final Sample 1 Solutions


1. While Loop Simulation

Function Call Output


mystery(5, 0) 5
mystery(3, 2) 1 0 1
mystery(16, 5) 3 2 1 0 1
mystery(80, 9) 8 4 2 1 2 0 2
mystery(1600, 40) 40 19 2 9 0 4 0

2. Inheritance Mystery
21 of 23
b
c 1
a 2 c 1

b
c 1
b 2 c 2

c
c 1
c 2

b
d 1 b 2 c 2
b 2 c 2

3. Collections Mystery
Function Call Contents of Set Returned
-----------------------------------------------
mystery(grid, 2, 2) [6, 7]
mystery(grid, 0, 2) [1, 2, 5, 8]
mystery(grid, 3, 3) [1, 2, 3, 7, 9]

4. List Programming
def is_unique(list):
for i in range(1, len(list)):
for j in range(i, len(list)):
if (list[i - 1] == list[j]):
return False
return True

5. Collections Programming
def count_in_area_code(numbers, area_code):
unique_numbers = set()
for name, phone in numbers.items():
if (phone[0:3] == area_code):
unique_numbers.add(phone)
return len(unique_numbers)

6. Programming
def same_pattern(s1, s2):
if (len(s1) != len(s2)):
return False
for i in range(0, len(s1)):
for j in range(i + 1, len(s1)):
if (s1[i] == s1[j] and s2[i] != s2[j]):
return False
if (s2[i] == s2[j] and s1[i] != s1[j]):
return False
return True

22 of 23
7. 2d Lists

def find_max(lis):
max_sum = 0
max_row = 0
for i in range(0, len(lis)):
cur_sum = 0
cur_row = i
for j in range(0, len(lis[i])):
cur_sum += lis[i][j]
if cur_sum > max_sum:
max_sum = cur_sum
max_row = cur_row
return max_row

8. Critters
class Ostrich(Critter):
def __init__(self):
super(Ostrich, self).__init__()
self.__hiding = True
self.__steps = 0
self.__west = randint(0, 1) == 0

def get_color(self):
if (self.__hiding):
return "cyan"
else:
return "white"

def get_move(self):
if (self.__steps == 10):
self.__steps = 0 # Pick a new direction and re-set the steps counter
self.__hiding = not self.__hiding
self.__west = randint(0, 1) == 0

self.__steps += 1
if (self.__hiding):
return DIRECTION_CENTER
elif (self.__west):
return DIRECTION_WEST
else:
return DIRECTION_EAST
9. Classes
def compare(other):
if (self.__month < other.__month or (self.__month == other.__month and
self.__day < other.__day)):
return -1
elif (self.__month == other.__month and self.__day == other.__day):
return 0
else:
return 1

23 of 23
Other documents randomly have
different content
The Project Gutenberg eBook of An Account of
the Abipones, an Equestrian People of
Paraguay, (1 of 3)
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: An Account of the Abipones, an Equestrian People of


Paraguay, (1 of 3)

Author: Martin Dobrizhoffer

Release date: December 6, 2015 [eBook #50629]


Most recently updated: October 22, 2024

Language: English

Credits: Produced by readbueno and the Online Distributed


Proofreading Team at http://www.pgdp.net (This file
was
produced from images generously made available by
The
Internet Archive)

*** START OF THE PROJECT GUTENBERG EBOOK AN ACCOUNT OF


THE ABIPONES, AN EQUESTRIAN PEOPLE OF PARAGUAY, (1 OF 3)
***
The cover was produced by the transcriber
and is in the public domain.
AN

ACCOUNT

OF

THE ABIPONES,

AN EQUESTRIAN PEOPLE

OF

PARAGUAY.

--~~--

FROM THE LATIN OF MARTIN DOBRIZHOFFER,

EIGHTEEN YEARS A MISSIONARY IN THAT COUNTRY.

--~~--

IN THREE VOLUMES.

VOL. I.

=========
LONDON:
JOHN MURRAY, ALBEMARLE STREET.
1822.
London: Printed by C. Roworth,
Bell-yard, Temple-bar.
PREFACE.

Martin Dobrizhoffer was born at Gratz in Styria, on the


7th of September, 1717. In the year 1736, he entered
the order of the Jesuits; and in 1749 went as a
Missionary to South America, where for eighteen years
he discharged the duties of his office, first in the
Guarany Reductions, latterly in a more painful and
arduous mission among the Abipones, a tribe not yet
reclaimed from the superstitions and manners of savage
life. Upon the expulsion of the Jesuits from Spanish
America, he returned to his native country, and, after
the unjust and impolitic extinction of his order,
continued to reside at Vienna till his death, which took
place July 17, 1791. The Empress Maria Theresa used
frequently to send for Dobrizhoffer, that she might hear
his adventures from his own lips; and she is said to
have taken great pleasure in his cheerful and animated
conversation.
These notices concerning him have been obtained
from one of the last survivors of his celebrated order.
In 1784, he published the work, a translation of which
is now laid before the public. The original title is Historia
de Abiponibus, Equestri, Bellicosaque Paraquariæ
Natione, locupletata copiosis Barbararum Gentium,
Urbium, Fluminum, Ferarum, Amphibiorum, Insectorum,
Serpentium præcipuorum, Piscium, Avium, Arborum,
Plantarun, aliarumque ejusdem Provinciæ Proprietatum
Observationibus; Authore Martino Dobrizhoffer,
Presbytero, et per Annos duodeviginti Paraquariæ
Missionario. A German translation, by Professor Kreil of
the University of Pest, was published at Vienna in the
same year. There is no other work which contains so
full, so faithful, and so lively an account of the South
American tribes.
His motives for undertaking the work, and his apology
for the manner in which it is executed, may best be
given in his own words:—
"In America, I was often interrogated respecting
Europe; in Austria, on my return to it, after an absence
of eighteen years, I have been frequently questioned
concerning America. To relieve others from the trouble
of inquiring, myself from that of answering inquiries, at
the advice of some persons of distinction, I have applied
my mind to writing this little history; an undertaking
which, I am aware, will be attended with doubtful
success and infinite vexation, in this age, so abundant in
Aristarchi, accustomed to commend none but their own,
or their friends' productions, and to contemn, as
abortive, those of all other persons."
"A seven years' residence in the four colonies of the
Abipones has afforded me opportunities of closely
observing their manners, customs, superstitions, military
discipline, slaughters inflicted and received, political and
economical regulations, together with the vicissitudes of
the recent colonies; all which I have described with
greater fidelity than elegance, and for the want of this I
am surely to be pardoned; for who can expect the
graces of Livy, Sallust, Cæsar, Strada, or Maffeus, from
one who, for so many years, has had no commerce with
the muses, no access to classical literature? Yet in
writing of savages, I have taken especial care that no
barbarisms should creep into my language. If my
sincerity be only acknowledged, I shall have attained my
object: for candour was always the most noble
ornament of an historian. To record true, and as far as
possible well-established facts, has been my chief aim.
When you read, I do not ask you to praise or admire,
but to believe me; that I think I may justly demand."
"What I have learnt amongst the Paraguayrians in the
course of eighteen years, what I have myself beheld in
the colonies of the Indians and Spaniards, in frequent
and long journeys through woods, mountains, plains,
and vast rivers, I have set forth, if not in an eloquent
and brilliant narration, certainly in a candid and accurate
one, which is at least deserving of credit. Yet I do not
look upon myself as a person incapable of making a
mistake, and unwilling to be corrected. Convince me of
error and I shall yield, and become as pliable as wax.
Yet I advise you to proceed with caution; for you may
err in judging as well as I in writing. So far am I from
deeming this little work of mine perfect, that before it is
printed and published, I intend to correct and polish it.
But as I am now fast approaching my six-and-sixtieth
year, I dare no longer defer the publication, lest the
work should prove a posthumous one. These premises I
have thought proper to make. Adieu! friendly reader,
whoever you are; and pardon the errors of the press,
and of the author likewise: for, Nihil humanum a me
alienum puto."
In the course of the work, Dobrizhoffer frequently
takes occasion to refute and expose the erroneous
statements of other writers respecting the Jesuits in
Paraguay, and the malignant calumnies by which the
ruin of their institutions in that country was so unhappily
effected. It has been deemed advisable to omit many of
these controversial parts, which, though flowing
naturally from one who had been an active member of
that injured society, must of course be uninteresting in
this country, and at these times. In other parts also, the
prolixity of an old man, loving to expatiate upon the
pursuits and occupations of his best years, has been
occasionally compressed. No other liberty has been
taken with the translation. The force and liveliness and
peculiarity of the original must of necessity lose much,
even in the most faithful version. Yet it is hoped, that
under this inevitable disadvantage, Dobrizhoffer will still
be found one of those authors with whom the reader
seems to become personally familiar.
CONTENTS

OF

VOL. I.

PART I.

Prefatory Book on the State


of Paraguay.

Page.

Of its Length and Breadth 1

Of the Geographical Charts of


Paraguay ib.

Of the Division of the whole


Province 2

Of the City, Port, and


Inhabitants of Buenos-Ayres ib.

Of Nova Colonia do 4
Sacramento

Of the new Limits established


in Paraguay, at the last Peace,
between the Spaniards and
Portugueze 7

Of the Port, Castle, and


Fortification of the city of
Monte-Video 8

Of the Gulf of Maldonado 9

Of the cities of Sta. Fè and


Corrientes 10

Of the thirty Guarany towns


subject to the jurisdiction of
the Governor of Buenos-Ayres 12

Of the sedition of the


Uruguayans on account of the
cession of their towns to the
Portugueze 18

Of the Fable of the pretended


King Nicholas, and its origin 27

Of the famous General Pedro


Ceballos, Royal Governor of
Buenos-Ayres 35
Of Tucuman, and the cities of
Cordoba, St. Iago, &c. 40

Of Sta. Cruz de la Sierra, and


the colonies of the Chiquitos 46

Of the Jesuits called into


Paraguay by Francis Victoria,
Bishop of Tucuman 47

Of the Province of Paraguay 49

Of its Metropolis, Asumpcion 50

Of the new Colonies of the


Ytatingua Indians, St.
Joachim, and St. Stanislaus 52

Of the Savages discovered by


me in Mbaevera 60

Of the Colony which I


intended to found for them 82

Of my Excursion to the River


Empelado 87

Of the Colony of Belen


constructed for the Mbaya
Savages 96
Of the native Productions of
this Country 99

Of the Herb of Paraguay 100

Of Tobacco 109

Of the Payaguas, Guaycurus,


Abipones, Mocobios, and
other Savages hostile to this
Province 113

Of the Province of Chaco, the


retreat of the Savage Nations 118

Of the other Indian Tribes,


who wander without Chaco,
chiefly those who dwell
towards the South 126

Of the exceeding fidelity


which the Guaranies have
always manifested towards
the Spaniards in the Royal
Camps, and of the signal
services which they have
performed there 133

Of the Colonies founded by us


for the Indians of the
Magellanic Region, and of
their fate 138
Of the Voyage of three Jesuits
to explore the shores of
Magellan, undertaken by
command of King Philip V. 146

Of the Shipwreck of the


Spaniards near Terra del
Fuego, and of the Inhabitants
of that Island 151

Of the Island of St. Maló


occupied by the French, and
afterwards sold to the
Spaniards 154

Of the Brazilian Mamalukes,


Destroyers of the Guarany
towns, and Hunters of the
Indians 157

Of the Slavery of the Indians


prohibited or regulated by
Royal Edicts 163

Of the Principal Rivers; the


Parana, Paraguay, and
Uruguay, and of the other
lesser streams which are
absorbed by them 167

Of the horrid Cataract of the


River Parana 185
Of another smaller one 186

Of the creation of fresh


Islands, and the destruction
of old ones 188

Of the two yearly Floods ib.

Of the Magnitude, Ports,


Shoals, &c. of the River
Parana, which, near the city
of Buenos-Ayres, bears the
name of La Plata 189

Of the various perils to be


encountered in the navigation
of this river 192

Of the Want of Metals and


Precious Stones in Paraguay 202

Of the various Attempts, and


false Stories of Portugueze
and Spaniards, possessed
with an Idea of finding Metals
there ib.

Of the incredible Multitudes of


Horses, Mules, Oxen, and
Sheep 218

Of the Hunting of Wild Oxen 221


Of the Voracity of the Indians 223

Of the Form, Variety,


Teaching, Diseases, Cures,
&c. of the Paraguayrian
Horses 224

Of Mules 240

Of Asses 244

Of the Management of Sheep 246

Of the various Temperatures


of the Air, and other
peculiarities of the Climate of
Paraguay 247

Of certain Wild Beasts; the


Tiger, Lion, Anta, Tamandua,
Huanaco, &c. 251

Of Amphibious Animals; the


Crocodile, Seal, Otter,
Capiiguára, Yguanà, &c. 291

Of the more rare Birds, as the


Emu, Parrot, Tunca, Cardinal,
&c. 308

Of many Species of Fish 333


unknown to Europe, and of
various Methods of Fishing

Of remarkable Trees; the Holy


Wood, Guayacàn, Cedar,
Cupaỹ, and of Medicinal
Plants; as China Chinæ, Zarza
Parrilla, Rhubarb, Sassafràs,
&c. 349

Of the Productions of
America; the Mandioc, Sugar-
cane, Cotton, Rice, &c. 389

Of various kinds of Vegetables 428

Of the Petrifaction of Wood


and Bones 433

Of Hot Springs ib.


AN ACCOUNT

OF

THE ABIPONES.

PREFATORY BOOK ON THE STATE OF PARAGUAY.

Paraguay is a vast region in South America, extending


very widely in every direction. From Brazil to the
kingdoms of Peru and Chili, they reckon 700 Spanish
leagues: from the mouth of the river La Plata, to the
northern region of the Amazons, 1,100. Some reckon
more, some fewer leagues, according as they use
German, French, or Spanish miles. Concerning this
matter, a determinate opinion must not be expected.
These huge tracts of land, receding very far from the
Colonies, are not yet rightly explored; possibly, never
will be.
Geometry is there a rara avis; and were any one
capable of measuring the land, and desirous of the
attempt, he would want the courage to enter it,
deterred either by the fear of savages, or by the
difficulties of the journey. Men of our order, seeking out
savages for God and the Catholic King, examined the
coverts of its forests, the summits of its mountains, and
the banks of its remotest rivers, traversing, to the
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

testbankmall.com

You might also like