Full Download of Introduction to Programming Using Python 1st Edition Schneider Test Bank in PDF DOCX Format
Full Download of Introduction to Programming Using Python 1st Edition Schneider Test Bank in PDF DOCX Format
https://testbankdeal.com/product/introduction-to-programming-using-
python-1st-edition-schneider-solutions-manual/
testbankdeal.com
https://testbankdeal.com/product/introduction-to-programming-using-
visual-basic-10th-edition-schneider-test-bank/
testbankdeal.com
https://testbankdeal.com/product/introduction-to-programming-using-
visual-basic-2012-9th-edition-schneider-test-bank/
testbankdeal.com
https://testbankdeal.com/product/horngrens-accounting-the-managerial-
chapters-10th-edition-nobles-solutions-manual/
testbankdeal.com
Differential Equations Computing and Modeling and
Differential Equations and Boundary Value Problems
Computing and Modeling 5th Edition Edwards Solutions
Manual
https://testbankdeal.com/product/differential-equations-computing-and-
modeling-and-differential-equations-and-boundary-value-problems-
computing-and-modeling-5th-edition-edwards-solutions-manual/
testbankdeal.com
https://testbankdeal.com/product/biology-exploring-the-diversity-of-
life-canadian-3rd-edition-russell-test-bank/
testbankdeal.com
https://testbankdeal.com/product/statistics-for-management-and-
economics-10th-edition-gerald-keller-test-bank/
testbankdeal.com
https://testbankdeal.com/product/rodaks-hematology-clinical-
principles-and-applications-5th-edition-keohane-test-bank/
testbankdeal.com
https://testbankdeal.com/product/busn-introduction-to-business-
canadian-3rd-edition-kelly-test-bank/
testbankdeal.com
TX GOV 1st Edition Maxwell Solutions Manual
https://testbankdeal.com/product/tx-gov-1st-edition-maxwell-solutions-
manual/
testbankdeal.com
Chapter 5
Multiple Choice (21) WARNING: CORRECT ANSWERS ARE IN THE SAME POSITION AND TAGGED WITH **.
YOU SHOULD RANDOMIZE THE LOCATION OF THE CORRECT ANSWERS IN YOUR EXAM.
1. When reading data from a file, the open function returns a(n) __________.
a. file object **
b. file name
c. file handle
d. file tuple
3. After all the lines of a file have been read, the readline method returns __________.
a. the empty string **
b. an empty tuple
c. the value None
d. a Throwback error
4. Python uses a(n) __________ as a temporary holding place for data to be written to disk.
a. buffer **
b. temp space
c. special memory location
d. list
6. Which standard library module do you need to import in order to use the remove and rename
functions for files?
a. os **
b. file
c. path
15. To avoid a potential runtime error when opening files for reading or writing:
a. use the os.path.isfile function **
b. use the os.path.file.exists function
c. prompt the user for the action to take if the file does not exist
d. use the Boolean value try to check if the file exists
18. Each piece of data in a CSV file record is referred to as a(n) __________.
a. field **
b. record
c. tuple
d. line
19. In a dictionary, a pair such such as “dog” : “rover” is called a(n) __________.
a. item **
b. pair
c. key
d. couple
20. Which file format stores data as a sequence of types that can only be access by special readers?
a. binary **
b. text
21. In order for Python to use functions to work with binary files, you must first import which
standard library module?
a. pickle **
b. os
c. binaries
d. osfile
True/False (23)
1. After all the lines of a file have been read, the readline method returns the value None.
Answer: false
2. You must close a file in order to guarantee that all data has been physically written to the disk.
Answer: true
3. The remove and rename functions cannot be used with open files.
Answer: true
Answer: true
Answer: false
Answer: true
Answer: false
Answer: true
Answer: true
Answer: false
11. infile is a descriptive name bot not mandatory for file input usage.
Answer: true
12. An attempt to open a nonexistent file for input generates a syntax error.
Answer: false
13. If a file that already exists is opened for writing, the contents of the file will be erased.
Answer: true
Answer: false
Answer: true
Answer: true
17. The data in the fields of each record in a CSV file normally should be related.
Answer: true
Answer: true
Answer: true
Answer: false
Answer: false
Answer: true
1. Complete the following function to open the file for reading and read the contents into a single
string named contents.
def readFile(file):
Answer:
infile = open(file, ‘r’)
contents = infile.read()
2. Write a Python statement to open a file called names for writing and assign it to a variable called
outfile.
3. Write a Python statement to open a file called grades with the intent to add values to the end of
the file and assign it to a variable called outfile.
4. Write a single Python statement to convert the list [“spring”, “summer”, “fall”, “winter”] to a set
called seasons.
5. Write a single Python statement to convert the tuple (“spring”, “summer”, “fall”, “winter”) to a
set called seasons.
7. Explain the difference between a simple text file and a CSV-formatted file.
Answer: A simple text file has a single piece of data per line. A CSV-formatter file has several items
of data on each line with items separated by commas.
9. Write a Python statement to create a copy of the dictionary called dogs into a new dictionary
called canines.
11. Why can’t lists and sets serve as keys for dictionaries?
Answer: Because dictionary keys must be immutable objects. Lists and sets are mutable.
“By Jove! I had no idea the captain had so much sporting blood in
his veins,” murmurs Jack Ashley to himself, as he watches alternately
the challenging craft and the America. “It is a race fit for a king’s
delectation. I wonder whose yacht that is. I don’t remember seeing
her described in any of the papers, as she certainly would have been
if she were owned in New York. She is a big one, and a beauty, too.
And swift as the wind! But she doesn’t seem to be gaining now. No,
by Jupiter! We are gaining on her! The America has struck her gait
at last! But that’s a game craft there. She sticks to us like a leech
and refuses to be shaken off. Ah!”
The impromptu race has been in progress nearly half an hour, and
the two vessels, still less than an eighth of a mile apart, are
gradually drawing nearer each other. It is apparent that the yacht is
determined to continue the race at closer range, and has changed
her course for that purpose. Meanwhile the big cruiser has held to
her original course, and as the yacht straightens away for another
parallel run she has lost her former advantage and the two vessels
are practically on even terms.
It is a battle royal!
The white cruiser is cleaving the water with tremendous speed,
her bow sending the spray curling nearly as high as her armored
top, while the waves astern are churned by her triple screws into a
foam that extends as far as the eye can reach. The roaring of her
furnaces is audible above the whir of the machinery and the
whistling of the wind through the rigging. From her three great
smokestacks steadily increasing masses of inky smoke trail out
above the snowy wake.
All eyes on the deck of the cruiser are riveted on the yacht. For a
short space of time it looks as if both vessels might be propelled by
the same power, so even are their relative positions. Then, to the
practical eyes aboard the cruiser, it is apparent that the America is
drawing ahead, slowly to be sure, and imperceptibly to the untrained
eye, but still gaining.
A dozen yards, a quarter length, a half, a clear length ahead!
A hearty cheer is trembling on the lips of the crew of the cruiser,
but it is not uttered. The race is still unfinished, the victory still
hangs in the balance.
Like a thoroughbred that has been feeling her antagonist, the
yacht now seems to respond to some undeveloped power. The
cruiser gains no more—she is losing her advantage. The watchers on
the quarterdeck of the America can see the black prow lessening the
open water that separates the two craft. Now her bow laps the stern
of the America, but not for long. She is overhauling the cruiser faster
now, and in a few minutes—seconds, it seems to the anxious
spectators on the latter vessel—she is abeam of the America.
Out beyond Sandy Hook, where the billows flash into curving
crests like the manes of wild horses, a great fleet has gathered to
watch the race against time of the famous warship. Instead it is their
privilege to witness a race between two of the swiftest sea hounds
ever unleashed on the trail of the wind.
Through the impromptu armada the racers speed over the
toppling seas. A thousand glasses are upon them. What does it
mean? The white cruiser all may recognize, but her sable-hulled
consort, what is she? Straight out from staff and halyards the wind
whips the flag and ensigns of the America, but neither ensign nor
flag does the strange steamship show, and except for the great
white wake that trails behind her she might be a phantom ship,
another Flying Dutchman.
But ere the “reviewing stand” recovers from its first surprise, both
craft are miles away, black bow and white bow piling over hills of
foam like sleighs over snowdrifts and the surge that goes sobbing
along the glistening sides of the cruiser, inaudible above the roar of
her mighty engines, sounds like the weeping for a lost race.
For the black hull is bow and bow with the white, as, after a long
and critical survey of the yacht from the bridge, Capt. Meade
descends to the deck and summons the chief engineer.
“Everything is working finely, sir,” that official reports. “We are
steaming the extreme limit under natural draught. Shall we try the
forced now, sir?”
Capt. Meade hesitates and again gazes long at the yacht. The
latter has now a clear length of open water to the good and her
stern is presented squarely in view for the first time. The single word
Semiramis is inscribed thereon in gold letters. But no port is
designated.
“The Semiramis,” murmurs the commander of the America. “I
never heard of the craft before, but her name will be on every man’s
lips before long, I’ll wager.” Then to the chief engineer: “Yes, put on
the forced draught.”
Jack Ashley wipes the marine glasses with which the
thoughtfulness of the second officer has provided him, and turns
them again toward the afterdeck of the yacht.
“Well, may I be keelhauled, or some other equally condign
nautical punishment,” he mutters, after a long look. “If that isn’t
Louise Hathaway, seated in a steamer chair, then do my optics play
me strange pranks. But what is she doing on the deck of that yacht?
She appears to be alone; at least there is no other lady passenger
on deck. Ah, there is Mr. Felton. So Barker was too late. Felton and
Miss Hathaway must be the guests of the gay yachtsman who is
making ducks and drakes of the America on her trial trip.
“Thunder and Mars!” cries the newspaper man, nearly dropping
the glasses to the deck. “Phillip Van Zandt! He is apparently the
owner of the yacht. Good heavens! What irony of fate brings
together those two participants in the Raymond tragedy. For Van
Zandt is Ernest Stanley, I will swear it.
“Well, as the novelists say, the plot thickens. How did Van Zandt
ingratiate himself into the good graces of Cyrus Felton? It must have
been recently, for Miss Hathaway spoke as if they had no friends in
the city. Hang it all! I don’t just fancy the situation. How assiduously
he is waiting upon her now! Heigho, Jack! I think I would as soon
have reported this trial trip from the deck of the Semiramis.” At
which thought Ashley impatiently pitches over the rail the remains of
one of Capt. Meade’s favorite brand of cigars.
The black plumes of smoke that pour from the chimneys of the
America are becoming denser and larger. The forced draught is now
fully in operation, and in the boiler-rooms the half-naked stokers
ceaselessly feed the greedy fires.
The cruiser has reached the limit of her speed.
How is it with the Semiramis?
For a time the America seems to hold her own and even to gain
slightly. But the advantage is transitory. The yacht still apparently
has speed in reserve. Once more she leaps forward and not again is
opportunity afforded the America’s people to view her gleaming
sides.
For another hour both vessels are driven at their highest speed.
The Semiramis continues to gain upon the America, and is now
nearly a quarter of a mile ahead.
Half an hour later Capt. Meade sees a flag run up to the masthead
of the vanishing yacht. He gives an order and the cruiser’s forward
gun booms a salute.
“What do you make of that ensign, Mr. Smith?” inquires the
commander, turning to the second officer.
“A strange flag, sir, not the flag of any nation that I recall,” is the
reply.
“Ah, I have it,” suddenly exclaims the captain. “Well, she is a great
craft and magnificently handled. The America made a gallant fight
against odds and lost; but you can say, Mr. Ashley,” as that individual
ascends the steps to the bridge, “that the America has broken all
records in the navies of the world, and for two consecutive hours
has exceeded twenty-seven knots an hour. Yonder craft has beaten
that time, but she has not the heavy armament of the America.”
“What was the ensign she ran up a moment ago, captain?” Ashley
asks.
“That, sir,” replies Capt. Meade, “was the flag of Cuba Libre, the
emblem of the sometime republic of the Antilles!”
CHAPTER XXIX.
ON TO FAIR CUBA.
“We shall have a race, Don Manada—a battle royal. The new
United States cruiser America has just steamed out of the bay ahead
of us and we shall soon be abreast of her.”
“A race, Senor Van Zandt? Santissimo! We shall have racing
enough before we get to Cuba without challenging unsuspicious
warships and courting investigation.”
Van Zandt laughs at the Cuban gentleman’s anxious tones. “I told
you, my friend, that once on the high seas nothing short of a cannon
ball can overhaul the Semiramis. Come on deck in an hour, senor,
and I will prove to you what may now seem an idle boast.”
For excellent reasons Manada is keeping in the background as
much as possible. But he finds the luxurious cabin of the Semiramis
much to his liking, and he smokes and dreams of “Cuba Libre” while
the Semiramis steams down the bay and out upon the bosom of the
Atlantic, and when he goes on deck, wrapped in the long semi-
military cloak which effectually conceals his person, the sight which
greets his eyes fills him with apprehension, though challenging his
liveliest interest.
The battle of steam is well under way. The America is less than a
dozen lengths astern and presents a beautiful sight to the people on
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.
testbankdeal.com