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


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

Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
what school?
biomolecules are e building blocks of every organics and inorganic materials.
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
sciencedirect big data base
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
characteristics of micro business
for teaching engĺish at school how nano technology help us
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
what is the actual application of fullerenes nowadays?
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
is Bucky paper clear?
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Do you know which machine is used to that process?
how to fabricate graphene ink ?
for screen printed electrodes ?
What is lattice structure?
s. Reply
of graphene you mean?
or in general
in general
Graphene has a hexagonal structure
On having this app for quite a bit time, Haven't realised there's a chat room in it.
what is biological synthesis of nanoparticles
Sanket Reply
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

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?