1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kazeer [188]
2 years ago
11

Write a function named test_sqrt that prints a table like the following using a while loop, where "diff" is the absolute value o

f the difference between my_sqrt(a) and math. Sqrt(a).
SAT
1 answer:
9966 [12]2 years ago
6 0

The function illustrated the use and the application of the while loops

While loops are used to perform iterative operations

The test_sqrt function in Python is as follows:

#This imports the math module

import math

#This defines the test_sqrt function    

def test_sqrt():

   #This initializes variable a to 1

   a = 1

   #The following is iterated for the values of variable a from 1 to 25

   while a<=25

   #This prints the required output

   print('a =', a,'| my_sqrt(a) =',my_sqrt(a),'| math.sqrt(a) =', math.sqrt(a),'| diff =', abs(math.sqrt(a)-my_sqrt(a)))

   #This increments a by 1

   a = a + 1

Note that:

Comments are used to explain each line in the above function

Read more about while loop at:

brainly.com/question/12736327

You might be interested in
Which excerpt from the passage uses imagery to describe the scene? "But they woke at dawn as usual. . . Suddenly remembering the
Harlamova29_29 [7]

Answer:

They rolled in the dew, they cropped mouthfuls of the sweet summer grass, they kicked up clods of the black earth and snuffed its rich scent.”

Explanation:

sorry i was late :')

7 0
2 years ago
Read 2 more answers
Fast food restaurants keep food warm by placing them under heat lamps. These lamps transfer heat by what means?
Serggg [28]

Answer:

Fast food restaurants keep food hot with infrared lamps. The heat is transferred to the food by radiation

Explanation:

the heat lamps produce radiation just like a microwave.

8 0
2 years ago
Each person at Louie's barbecue used 3/8 cup of barbecue sauce. There were 7 people at the barbecue. How may cups of barbecue sa
Sever21 [200]
2 cups technically a lil more than that but it asked how many CUPS so
5 0
3 years ago
Heather had a pot filled with salt water. She could not see the salt inside the water, but she could taste that the water was sa
SpyIntel [72]

Answer:

A the salt is made of the same particles

3 0
3 years ago
After the end of world war ii, nations met at the _______ to create a new worldwide economic system.
madam [21]
They met at the Mount Washington Hotel I believe.
3 0
2 years ago
Other questions:
  • Michelle is planting flowers in her garden. She wants the ratio of daisies to carnations to be 3 to 2. Michelle wants to plant a
    6·1 answer
  • What is the value of X?
    6·2 answers
  • I'm looking into colleges. Does anyone know of any good premed colleges?
    7·2 answers
  • Match each gymnosperm to it's correct description
    14·2 answers
  • What information should be in a character sketch?<br><br><br> please answer quick
    7·2 answers
  • Rewrite the following sentence using a direct object pronoun. Nosotros comemos las manzanas. Nosotros los comemos. Nosotros las
    12·1 answer
  • Which of the following best characterizes the new kingdom.
    12·1 answer
  • A first messenger molecule activates a receptor that stimulates enzyme a, which synthesizes 100 second messenger molecules. In t
    9·1 answer
  • A woman is in the fourth stage of labor. During the first hour of this stage, the nurse would assess the woman's fundus at which
    6·1 answer
  • The inner (internal) membrane of the chloroplasts which contains chlorophyll and other light capturing pigments is also called t
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!