<< Chapter < Page Chapter >> Page >
This module contains review questions and answers keyed to the module titled Itse1359-1720-Doctest as well as review questions and answers keyed to the document at https://docs.python.org/3/library/doctest.html.

Table of contents

Preface

This module is one in a collection of modules on Python designed for teaching ITSE 1359 Introduction to Scripting Languages: Python at Austin Community College in Austin, TX.

This module contains review questions and answers keyed to the module titled Itse1359-1720-Doctest . In addition, some of the questions and answers are keyed to the document titled The Python Standard Library -- 26.2 doctest -- Test interactive Python examples .

Once you study that material, you should be able to answer the review questions in this module.

The questions and the answers in this module are connected by hyperlinks to make it easy for you to navigate from the question to the answer and back again.

(Note to blind and visually impaired students: with the exception of two bitmap images that are used solely as spacers to separate the questionsection from the answer section, all of the material in this module is presented in plain text format and should be accessible using an audio screen reader or abraille display. Note however that the required indentation may not be properly represented by an audio screen reader.)

Questions

Question 1

True or False? The test file shown in Figure 1 , when executed using the command shown in Figure 2 , produces the output shown in Figure 3 .

Figure 1 . Question 1 test code named Py1359_1720r_01.txt.
Beginning of first test>>>2 + 3 5End of first test Beginning of second test>>>2 + 3 6End of second test
Figure 2 . Question 1 execution command.
python -m doctest Py1359_1720r_01.txt
Figure 3 . Question 1 possible output.
********************************************************************** File "Py1359_1720r_01.txt", line 2, in Py1359_1720r_01.txtFailed example: 2 + 3Expected: 6Got: 5********************************************************************** File "Py1359_1720r_01.txt", line 7, in Py1359_1720r_01.txtFailed example: 2 + 3Expected: 6Got: 5********************************************************************** 1 items had failures:2 of 2 in Py1359_1720r_01.txt ***Test Failed*** 2 failures.

Go to answer 1

Question 2

True or False? The test file shown in Figure 5 , when executed using the command shown in Figure 6 , produces the output shown in Figure 7 .

Figure 5 . Question 2 test code named Py1359_1720r_02.txt.
Beginning of test>>>2 + 3 5End of test
Figure 6 . Question 2 execution command.
python -m doctest Py1359_1720r_02.txt -v
Figure 7 . Question 2 possible output.
Trying: 2 + 3Expecting: 5ok 1 items passed all tests:1 tests in Py1359_1720r_02.txt 1 tests in 1 items.1 passed and 0 failed. Test passed.

Go to answer 2

Question 3

True or False? Given the Python module shown in Figure 9 , when the test file shownin Figure 10 is executed using the command shown in Figure 11 , it produces theoutput shown in Figure 12 .

Questions & Answers

what's Thermochemistry
rhoda Reply
the study of the heat energy which is associated with chemical reactions
Kaddija
How was CH4 and o2 was able to produce (Co2)and (H2o
Edafe Reply
explain please
Victory
First twenty elements with their valences
Martine Reply
what is chemistry
asue Reply
what is atom
asue
what is the best way to define periodic table for jamb
Damilola Reply
what is the change of matter from one state to another
Elijah Reply
what is isolation of organic compounds
IKyernum Reply
what is atomic radius
ThankGod Reply
Read Chapter 6, section 5
Dr
Read Chapter 6, section 5
Kareem
Atomic radius is the radius of the atom and is also called the orbital radius
Kareem
atomic radius is the distance between the nucleus of an atom and its valence shell
Amos
Read Chapter 6, section 5
paulino
Bohr's model of the theory atom
Ayom Reply
is there a question?
Dr
when a gas is compressed why it becomes hot?
ATOMIC
It has no oxygen then
Goldyei
read the chapter on thermochemistry...the sections on "PV" work and the First Law of Thermodynamics should help..
Dr
Which element react with water
Mukthar Reply
Mgo
Ibeh
an increase in the pressure of a gas results in the decrease of its
Valentina Reply
definition of the periodic table
Cosmos Reply
What is the lkenes
Da Reply
what were atoms composed of?
Moses Reply
what is chemistry
Imoh Reply
what is chemistry
Damilola
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Itse 1359 introduction to scripting languages: python. OpenStax CNX. Jan 22, 2016 Download for free at https://legacy.cnx.org/content/col11713/1.32
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Itse 1359 introduction to scripting languages: python' conversation and receive update notifications?

Ask