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 of the following is not true about the moon.
Nesterboy [21]

Which of the following in not true about the moon?

Answer: Small, airless rocky bodies revolving around the sun between the orbits of Mars and Jupiter that are too small to be called planets are asteroids. ... Mass of asteroids is less than that of Earth's moon.

7 0
3 years ago
Quadrilateral abcd is a parallelogram. What is bc?.
bixtya [17]

Answer:36

Explanation:

4 0
3 years ago
laura is supplied with 5 bolts (b) and 12 nuts (n). she attached the nuts to the bolts in a 2:1 ratio (n2b). which of the reacta
kolbaska11 [484]

Limiting reagents are the chemicals that limit the formation of the products in the reaction. Bolts will limit product formation.

<h3>What are limiting and excess reagents?</h3>

Limiting reagents are the chemical reactants that are present in less quantity and get consumed first hence limiting the product formation. In the above case, bolts are limiting reagents as they are less in number and limit the formation of the nut bolt attachment.

Excess reagents are chemicals that are present in more quantities and remain even after the product is formed. Hence, nuts are excess reagents as they are present in more quantities and will remain even if bolts are finished.

Therefore, bolts limit product formation.

Learn more about limiting agents here:

brainly.com/question/15230513

#SPJ1

4 0
2 years ago
Which of the following should caregivers NOT do in supporting parents and toddlers with separation?
melisa1 [442]
My guess is A you want the child to feel support and you don’t want the parents hanging around making that hard but you want the parents to know that you are doing your part. If you distract the child he or she will not learn and may feel upset that he or she didn’t know they left.
6 0
3 years ago
Read 2 more answers
Ngữ văn lớp 6 vở bài tập ,tập 1
kari74 [83]

Answer:

Explanation:

huh?

7 0
3 years ago
Other questions:
  • How do u paint ur finger nails if ur right handed
    13·2 answers
  • Qual e o seu nome? Eiii voce ai
    8·1 answer
  • SAT Scores Suppose that the mathematics SAT scores for high school seniors for a specific year have a mean of 456 and a standard
    7·1 answer
  • Como se llama el presidente de Guatemala ​
    15·1 answer
  • Paleomagnetism is... Question 11 options: The study of rocks Collecting oceanic rocks The study of magnets The study of the magn
    14·1 answer
  • on december 1, 2021, your company borrowed $15,000, a portion of which is to be repaid each year on november 30. specifically, y
    5·1 answer
  • The ratio of the lengths of the sides of abc is 2:3:4.
    6·1 answer
  • Las cenas de sergio son todas iguales. A la una de la tarde, sergio 1 of 2 (salir) para el supermercado, donde 2 of 2 (comprar)
    5·1 answer
  • Minor blows to the head never lead to long-term brain injury
    14·1 answer
  • Choose the excerpt that is from an opera aria by Mozart:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!