Introduction to Programming Using Python 1st Edition Schneider Test Bank all chapter instant download
Introduction to Programming Using Python 1st Edition Schneider Test Bank all chapter instant download
https://testbankdeal.com/product/introduction-to-programming-using-
python-1st-edition-schneider-solutions-manual/
https://testbankdeal.com/product/introduction-to-programming-using-
visual-basic-10th-edition-schneider-test-bank/
https://testbankdeal.com/product/introduction-to-programming-using-
visual-basic-2012-9th-edition-schneider-test-bank/
https://testbankdeal.com/product/horngrens-accounting-the-managerial-
chapters-10th-edition-nobles-solutions-manual/
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/
https://testbankdeal.com/product/biology-exploring-the-diversity-of-
life-canadian-3rd-edition-russell-test-bank/
https://testbankdeal.com/product/statistics-for-management-and-
economics-10th-edition-gerald-keller-test-bank/
https://testbankdeal.com/product/rodaks-hematology-clinical-
principles-and-applications-5th-edition-keohane-test-bank/
https://testbankdeal.com/product/busn-introduction-to-business-
canadian-3rd-edition-kelly-test-bank/
TX GOV 1st Edition Maxwell Solutions Manual
https://testbankdeal.com/product/tx-gov-1st-edition-maxwell-solutions-
manual/
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.
After a few days a box about one foot and a half long, one foot high
and nine inches wide, arrived. It was made of wood covered with a
kind of grey cloth, with strips of black leather about the edges and
small pieces of brass at every corner. There were leather grips on it
so that it could be carried as a satchel. It was my little portable altar,
containing everything necessary for saying Mass. One half opened
and stood upright from the part containing the table of the altar,
which when opened out was three feet long. Fitted into the oak table
was the little marble altar-stone, without which one may not say
Mass. In the top of the upright part was a square hole in which the
crucifix fitted to stand above the altar; on either side were holders to
attach the candlesticks. From the wall that formed a compartment in
the upright portion, where the vestments were kept, the altar cards
unfolded; these were kept in place by small brass clips attached to
the upright. Chalice, ciborium, missal and stand, cruets, wine, altar-
breads, bell, linens, etc., were in compartments beneath the altar
table. The whole was wonderfully compact and could be carried with
one hand.
As I write these words it stands nearby, sadly war-worn after its
voyage across the ocean, and its travels through England, France,
Belgium and the Rhineland of Germany. I have said Mass on it on
this side of the ocean; on the high seas; in camp in England; in
trenches; on battlefields; in tents, camps, and billets through the war-
scarred areas of France. I offered the Holy Sacrifice on it placed on a
low, wide window-sill in a German billet on our way through the
Rhineland. It was carried across the Rhine December 13th, 1918, in
the great triumphal march. Now it is home again. In many places the
cloth covering is scraped and torn; one of the brass corners is
missing. It is very soiled from the mud of France and rifle oil stains,
etc.; the leather edging is chipped and peeled. The table has been
broken and repaired again, so has the little book-stand. The silver
chalice and paten are slightly dented in many places. The little bell
has lost part of its handle, but its tone is still sweet. One alb has
been burned, but I have another. The cincture has been broken and
knotted.
I gaze at it now and think of the thousands of great-hearted lads who
knelt before it, often on rain-soaked fields, or stood among piles of
ruins and heard the sweet notes of the little bell warning them of the
Master’s approach, so that they might bow reverently when He
came; of the thousands on field, on hillside, in caves and huts who
knelt to eat of the Bread of Life, many of them going almost
immediately with this pledge of eternal life, before God to be judged,
—as I think of all this, there comes into my eyes a mist, and the little
portable altar grows dim.
Chapter V
In Training Camp
The time passed quickly for me, though I think for most of the men it
went slowly; they seemed always restless, always longing to get to
the front. They used to come to me often with their little grievances.
They seemed to think that their troubles would disappear once they
reached training-camp overseas.
I remember one Sunday, after I had finished Mass and the last
company had marched off the field, two soldiers came forward from
somewhere and saluted. One of them, the taller of the two, acted as
chief spokesman. “Father,” he said, “we have not heard Mass today.
We were ordered to go to the Protestant service.” Excitement
flashed in his eyes. “The service is just over, Father, and we slipped
over here to tell you.”
It was strictly against K. R. & O. to order Catholics to a non-Catholic
service. The lads did not belong to my battalion, but to a construction
battalion that had but lately come to camp. Headquarters of this
battalion were not far away, so I did not wait for my breakfast, but
obeyed the first impulse and went immediately to the training square
of the No. — Construction Co. The church parade was over and the
chaplain had just finished packing his books and was preparing to
leave the field with the adjutant. I asked the chaplain if the Catholics
had been ordered to attend the service. “Yes,” he said, and then
went on to explain that it was a universal church service and that all
the men had been ordered to attend.
I asked him to look up a book entitled K. R. & O. I told him that it was
a serious offense that had been committed; that my men had a right
to attend their own service; that there was no such thing known in
the army as a universal church parade.
When they saw they had made a mistake both chaplain and adjutant
were very apologetic. Shortly after this, when the battalion was to
leave for overseas, the chaplain wrote me a note asking me to hear
the confessions of the Catholics. I think they came to a man; two
other chaplains came to help me. This construction battalion was
composed mostly of men who had moved quite a lot over different
parts of the world, and had grown a little slack in the observance of
their religious duties. Big things were done for Our Lord that night.
Perhaps many would have passed the summer without even coming
to Mass had not this great indignity been offered them.
So the days passed quickly, and then one evening word came that
we were to leave—but only for another camp. There was great
rejoicing at first, for the lads thought that orders for “Overseas” had
come.
Chapter VIII
We Break Camp
It was Sunday, October 1st. It was the most beautiful day I have ever
seen. There had been a heavy frost during the night, and in the
morning the hills, which had been green all summer, but had lately
begun to put on their autumn tints, were glorious in bright scarlet,
yellow and russet, with still here and there a dark-green patch of
spruce. The white frost was on the ground and a covering of ice one-
eighth of an inch thick was formed on the basin of water in my tent.
The air was cold, clear and invigorating. The men were all in
excellent spirits. I said Mass for my own men, and then walked about
two miles towards the entrance to the camp to say Mass for the
other soldiers who still remained in the different areas. The Sabbath-
day stillness seemed more intense than ever. Perhaps it was on
account of the very small number left in the camp. When I turned
around after I had said Mass, I could not but pause in admiration of
the wonderful beauty of God’s works. I took for the text of my
sermon: “O Lord, Our Lord, how admirable is Thy name in the whole
world.” I told the lads that as Our Lord had made all things beautiful
we ought to keep our souls beautiful in His sight, and that one of the
surest means of doing so was to come to Holy Communion. Then I
preached on the Blessed Eucharist.
When I reached our own lines after Mass nearly all the tents had
been taken down and rolled up. I had breakfast at one of the men’s
cook stoves. We were to break camp at twelve o’clock. I think I was
the only one who was sorry to leave.
Things had gone very well during the summer; there had been many
consolations in the ministry. Many men who had passed long years
away from the sacraments had come into the white bell tent pitched
in the open space in the valley and, kneeling there, had been
reconciled after many years’ estrangement from God. I had watched
the men in the evening and had noticed how cheerful they were, how
much like boys they were in the tricks they played on each other.
One evening, shortly before we were to leave, a great bonfire had
been lighted. All through the day the men had worked at the base of
the slopes cutting down dry trees and carrying them out. The fire
was built in the square where the men drilled and took their physical
exercises in the mornings. It was a thrilling sight to watch the little
tongues of fire darting in and out among the pile of dry twigs,
increasing in size and speed till they developed into one great
waving pillar of flame that tore its way upward through the gigantic
pile of dry old trees, hissing, crackling and roaring as it went. The
flames must have reached forty feet in height, and at times the
sparks swarmed down on the tents like bees to a hive, and the
soldiers had to beat them out. The band marched around the flaming
pillar and played, keeping always within the circle of light made by
the fire. Many soldiers followed in procession, some of them
performing comical acrobatic feats as they went. There was an
almost new tent floor up near the colonel’s tent which some of the
lads thought would make excellent fuel for the fire. Presently about
eight of them were carrying it towards the flames. The quartermaster,
who had charge of the movables of the camp, saw them
approaching and immediately advanced from his place near the fire,
angrily shouting orders to them to put down the tent floor. They did,
though not till the indignant quartermaster was very near them. Then
they turned and ran quickly away. The quartermaster, who was a
heavy man, did not pursue them. He turned towards the fire, but only
to find that a number of rough tables and chairs had gone to satisfy
the hungry flames! He was very angry. The lads had become like
little children, and I think their souls had become like the souls of
little children.
And now we were going back to civilization! Our journey was one of
about four hundred miles through many small towns and cities to a
camp near the seaboard, where we were to wait a few weeks before
embarking. We left Valcartier at the time appointed, and all that day
and most of the evening our route lay along the noble St. Lawrence.
In the morning we came into our own Province of New Brunswick,
from the northern part of which our battalion had been recruited.
In many towns at which we stopped liquor was procured, and soon
there were evidences that many of the men had taken too much.
And when we drew near the town from the environs of which the
majority of the lads had been recruited a great number gave signs of
almost complete intoxication, so that parents who stood among the
great crowd which had gathered to see the lads as they passed
through were greatly humiliated. I felt sick at heart, for a public
holiday had been proclaimed and people had come from the whole
surrounding countryside to see the battalion for the last time before
going overseas. It was a gala-day. They had waited all morning, and
then many of the men who arrived were in every stage of
intoxication! It was very humiliating to the poor parents and the men
had been so good all summer!
When the train pulled out, I went back to my seat in the Pullman.
Two thoughts were working in my mind, so that my head felt a little
dazed and I did not hear the officers talking around me. Neither did I
perceive when they spoke to me. One thought was a very human
one. I felt terribly disheartened, and I wondered if the people thought
that the men had been drinking so during the summer, and I fell to
wishing that they could only know all about the men in camp. The
other thought was that I was grateful to God for having chosen me to
minister to them. For surely they needed a priest!
Chapter IX
The Panel of Silk
We did not stay very long in our new camping ground. For a few
days the men seemed quite content. Everything was new to them;
but soon they began to wonder how long it would be before we
would leave. The nights often were very cold in the tents, for it was
now late in October. We began to feel sure that orders for departing
must come soon as no preparations were being made for going into
winter quarters. On Sunday I had announced confessions for the
following Wednesday. On the day set, four priests came to help me,
but just as the men were being formed up to go to the church, word
came that we were to leave that evening for overseas. The men
were dismissed and soon there was a scene of general disorder; but
on all sides were happy faces. All seemed glad to go. They had been
looking forward to it for so long a time.
I was obliged to tell the priests who had come so far that there would
be no confessions. I kept the hosts that the Sisters in a nearby town
had made for me, as I hoped to hear the men’s confessions on the
boat on the way across the ocean.
All night long we stood around, waiting for the train to come to take
us, but there had been some delay, and so it was not till early in the
morning that we left. Our journey was not a very long one, but we
were obliged to wait at many different stations till trains passed us.
As the movement order had called for a night trip, no dining-car or
buffet had been attached. The men went hungry all day. The last trip
had been one of over-indulgence. This was one of abstinence.
We had no breakfast and no dinner, yet the men seemed quite
content, and joked pleasantly over the fact that they were hungry. At
one country station where we were side-tracked the bugler jumped
out on the platform and blew the call: “Come to the cook-house door,
boys!” But as there was no cook-house door to go to, and no
“Mulligan battery”—the name given to the field-kitchen, with its
steaming odors of Irish stew—they greeted the call of the smiling
bugler with derisive laughter.
At four o’clock we were all aboard the S. S. Corsican, and at five we
pulled out from the dock, the band on the upper deck playing “Auld
Lang Syne.” Many relatives of the lads, who had arrived in the little
seaport town, waved their good-byes from the dock as the boat
swung clear from its moorings and steamed slowly down the bay.
The boys swarmed up the rope ladders and cheered; many little tugs
far down on the water darted about, shrieking shrilly their farewells.
We were off to the war!
Chapter XI
The High Seas
The doctor and I had been alloted a stateroom together, but I was
subsequently given one down below, where I said Mass the first
morning and heard confessions every evening. The chief steward
was a Catholic and he was very kind. I had permission to say Mass
in the second-class saloon, which was the largest on the boat, and
nearly all the men came to Holy Communion. Our first Sunday out I
said Mass for the lads below. As I proceeded with the Mass the seas
became very rough, so that the book fell off the altar three times; the
chalice, however, never moved. Many became sick, and the Red
Cross section was busy. On the first day out we donned our
cumbersome life-belts, which we wore all the way across the
Atlantic. I took mine off only while saying Mass. They hung on the
berths at night. During the day the men walked up and down the
upper deck; sometimes there were drills, etc. We saw no vessels.
Every day we plunged forward through rough seas, and in the
afternoons, as I sat in my little stateroom hearing confessions, I
could hear the dull pounding of the waves on the sides of the vessel.
I was very pleased with the example the Catholic officers gave the
men. Every one of them came to confession and Communion on the
way over. One, the old quartermaster, who was confined to his cabin
with a severe attack of la grippe, could not come to Mass with the
others, so I gave him Communion in his cabin towards the last of the
voyage. The second morning afterwards, however, as I walked back
and forth making my thanksgiving, I stopped quickly and peered out
over the sea. I could see very faintly, across the water, a long,
serried line of hills that looked greyish-blue in the early morning—the
hills of Ireland! I ran quickly to tell the quartermaster, who had been
born in Ireland and had still a true Irishman’s great love for his native
land. He was not there. I was surprised, as the doctor had told me
that he had given orders that he was not to leave his cabin till after
we reached port. As I went out on deck again I noticed, up forward,
leaning over the gunwale and looking towards Ireland, a great
muffled figure. He wore one khaki great coat, and another, thrown
loosely about his shoulders, gave him a hunched appearance. It was
the quartermaster!
I went forward quickly: “Captain,” I said, “didn’t the doctor tell you not
to leave your stateroom till we docked?”
He didn’t say anything for a second or two, and I noticed a mist had
come into his eyes. Then he pointed far across the grey waste of
waters. “Ah, Father,” he said, “but there’s Ireland!”
Chapter XII
By Ireland
All day long we sailed by Ireland and she seemed strangely peaceful
and quiet. Perhaps it was the great contrast with the sea, the wide
tumbling waste of waters that, night and day, was always restless; or
perhaps it was a benediction resting over the whole country. Anyhow
it seemed that way to me as often as my eyes rested on the hills and
fields of holy Ireland. Since that morning I have seen many different
countries. I have come back to my own land over the same great
distance of waters, and it was in the early morning that I saw it first,
yet that strange spiritual peace that seemed to rest over Ireland was
decidedly lacking. That early morning scene still comes back to me;
and all through the day, whenever my eyes rested on the hills of
Ireland, I felt that I was making a meditation and that I was being
lifted in spirit far above the little things that bother one here below.
Down below us on the water, with the swiftness almost of swallows,
darted here and there the long grey anti-submarine boats. Seven or
eight of them had come to meet us. Later on in the day appeared the
mine sweepers, low short steam boats painted for the most part red,
and carrying one yard sails. The sails were of dark brownish-red
color. They worked in pairs.
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