<< Chapter < Page Chapter >> Page >
Figure 33 . Question 9 possible output.
Trying: divide(1,3)Expecting: 0.3333333333333333ok 1 items had no tests:__main__.divide 1 items passed all tests:1 tests in __main__ 1 tests in 2 items.1 passed and 0 failed. Test passed.

Go to answer 9

Figure index

  • Figure 1 . Question 1 test code named Py1359_1720r_01.txt.
  • Figure 2 . Question 1 execution command.
  • Figure 3 . Question 1 possible output.
  • Figure 4 . Question 1 actual output.
  • Figure 5 . Question 2 test code named Py1359_1720r_02.txt.
  • Figure 6 . Question 2 execution command.
  • Figure 7 . Question 2 possible output.
  • Figure 8 . Question 2 actual output.
  • Figure 9 . Question 3 Python module named Py1359_1720r_03.py.
  • Figure 10 . Question 3 test code named Py1359_1720r_03.txt.
  • Figure 11 . Question 3 execution command.
  • Figure 12 . Question 3 possible output.
  • Figure 13 . Question 4 Python module named Py1359_1720r_04.py.
  • Figure 14 . Question 4 execution command.
  • Figure 15 . Question 4 possible output.
  • Figure 16 . Question 5 Python module named Py1359_1720r_05.py.
  • Figure 17 . Question 5 execution command.
  • Figure 18 . Question 5 possible output.
  • Figure 19 . Question 6 Python module named Py1359_1720r_06.py.
  • Figure 20 . Question 6 execution command.
  • Figure 21 . Question 6 possible output.
  • Figure 22 . Question 7 Python module named Py1359_1720r_07_runner.py.
  • Figure 23 . Question 7 Python module named Py1359_1720r_07.py.
  • Figure 24 . Question 7 execution command.
  • Figure 25 . Question 7 test code named Py1359_1720r_07.txt.
  • Figure 26 . Question 7 possible output.
  • Figure 27 . Question 8 Python module named Py1359_1720r_08.py.
  • Figure 28 . Question 8 test code named Py1359_1720r_08.txt.
  • Figure 29 . Question 8 execution command.
  • Figure 30 . Question 8 possible output.
  • Figure 31 . Question 9 Python module named Py1359_1720r_09.py.
  • Figure 32 . Question 9 execution command.
  • Figure 33 . Question 9 possible output.
  • Figure 34 . Question 9 actual output.

What is the meaning of the following two images?

These images were inserted here simply to insert some space between the questions and the answers to keep them from being visible on the screen at thesame time.

Spacer image of a rabbit and a penguin.

This image was also inserted for the purpose of inserting space between the questions and the answers.

Spacer image of a penguin and some houses.

Answers

Answer 9

False. The actual output is shown in Figure 34 . This question was included topoint out that testing floating point results can be problematic. Many floating point values are simply estimates. Although this example was purposely caused tofail, a given floating point computation may not produce exactly the same results on different platforms. Therefore a test that specifies a given floatingpoint result may pass on one platform and fail on a different platform. The Python Standard Library -- 26.2 doctest -- Test interactive Python examples provides some suggestions for dealing with this issue.

Figure 34 . Question 9 actual output.
Trying: divide(1,3)Expecting: 0.333333********************************************************************** File "Py1359_1720r_09.py", line 4, in __main__Failed example: divide(1,3)Expected: 0.333333Got: 0.33333333333333331 items had no tests: __main__.divide********************************************************************** 1 items had failures:1 of 1 in __main__ 1 tests in 2 items.0 passed and 1 failed. ***Test Failed*** 1 failures.

Questions & Answers

what is phylogeny
Odigie Reply
evolutionary history and relationship of an organism or group of organisms
AI-Robot
ok
Deng
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
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