<< 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

how do you get the 2/50
Abba Reply
number of sport play by 50 student construct discrete data
Aminu Reply
width of the frangebany leaves on how to write a introduction
Theresa Reply
Solve the mean of variance
Veronica Reply
Step 1: Find the mean. To find the mean, add up all the scores, then divide them by the number of scores. ... Step 2: Find each score's deviation from the mean. ... Step 3: Square each deviation from the mean. ... Step 4: Find the sum of squares. ... Step 5: Divide the sum of squares by n – 1 or N.
kenneth
what is error
Yakuba Reply
Is mistake done to something
Vutshila
Hy
anas
hy
What is the life teble
anas
hy
Jibrin
statistics is the analyzing of data
Tajudeen Reply
what is statics?
Zelalem Reply
how do you calculate mean
Gloria Reply
diveving the sum if all values
Shaynaynay
let A1,A2 and A3 events be independent,show that (A1)^c, (A2)^c and (A3)^c are independent?
Fisaye Reply
what is statistics
Akhisani Reply
data collected all over the world
Shaynaynay
construct a less than and more than table
Imad Reply
The sample of 16 students is taken. The average age in the sample was 22 years with astandard deviation of 6 years. Construct a 95% confidence interval for the age of the population.
Aschalew Reply
Bhartdarshan' is an internet-based travel agency wherein customer can see videos of the cities they plant to visit. The number of hits daily is a normally distributed random variable with a mean of 10,000 and a standard deviation of 2,400 a. what is the probability of getting more than 12,000 hits? b. what is the probability of getting fewer than 9,000 hits?
Akshay Reply
Bhartdarshan'is an internet-based travel agency wherein customer can see videos of the cities they plan to visit. The number of hits daily is a normally distributed random variable with a mean of 10,000 and a standard deviation of 2,400. a. What is the probability of getting more than 12,000 hits
Akshay
1
Bright
Sorry i want to learn more about this question
Bright
Someone help
Bright
a= 0.20233 b=0.3384
Sufiyan
a
Shaynaynay
How do I interpret level of significance?
Mohd Reply
It depends on your business problem or in Machine Learning you could use ROC- AUC cruve to decide the threshold value
Shivam
how skewness and kurtosis are used in statistics
Owen Reply
yes what is it
Taneeya
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