<< 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 is biology
Hajah Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
what is biology
Victoria Reply
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
cell is the building block of life.
Condoleezza Reply
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