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
vovikov84 [41]
3 years ago
7

Package Newton’s method for approximating square roots (Case Study: Approximating Square Roots) in a function named newton. This

function expects the input number as an argument and returns the estimate of its square root. The script should also include a main function that allows the user to compute square roots of inputs until she presses the enter/return key
Computers and Technology
1 answer:
Shtirlitz [24]3 years ago
7 0

Answer:

def newton(n):

       #Define the variables.

       t = 0.000001

       esti = 1.0

       #Calculate the square root

       #using newton method.

       while True:

               esti = (esti + n / esti) / 2

               dif = abs(n - esti ** 2)

               if dif <= t:

                       break

   

       #Return the result.

       return esti

#Define the main function.

def main():

   

       #Continue until user press enters.

       while True:

               try:

         

                       #Prompt the user for input.

                       n = int(input("Enter a number (Press Enter to stop):"))

                       #display the results.

                       print("newton = %0.15f" % newton(n))

     

               except:

                       return

#Call the main function.

main()

You might be interested in
The voluntary linkage of computer networks around the world is called the ______.
77julia77 [94]
The voluntary linkage of computer networks around the world is called the internet which began to be used in the 1990s. It initially began being used in the 1960s by scientists with the aim of exchanging information about research. Between the year 1995 and late 2002, the number of those connected to the internet rose from 26 million to more than 600 million. Currently, internet has now become a way of life.








3 0
3 years ago
Why does temperature decrease with higher altitude?
Lelu [443]
It's B.

As you go up, the air thins out, meaning it is less dense. Since there are less molecules that can transfer heat, the temperature is lower.
4 0
3 years ago
When you are almost done with your soup and want to get at the last little bit, how should you do this 2
pav-90 [236]

Answer:

<u>B. Tip the bowl slightly, then spoon up the last bit</u>

Explanation:

Generally speaking none of the other answers made much of sense.. "tip the bowl from side to side" doesn't help you at all, neither does "Keep spooning as much as you can, then stop eating". Neither of these will help you spoon up the last little bit, <u>the most logical answer is B. "Tip the bowl slightly, then spoon up the last bit"</u>. If this is not the correct answer then it'd be D, but I don't believe/feel that it's "poor etiquette" to "leave the last little bit".

7 0
3 years ago
Which option ensures that a page break is automatically inserted ahead of a specific paragraph or heading?
gulaghasi [49]

The correct answer is option D, the last one! <3

6 0
3 years ago
Read 2 more answers
¿Cuáles son las dos ideas que confrontan en la "Revolución Tecnológica", cuando se refieren a la producción?
jeyben [28]

Answer:

._.  dont know spanish

Explanation:

6 0
3 years ago
Other questions:
  • A Color class has a method getColorName that returns a string corresponding to the common name for the color, e.g., yellow, blue
    11·1 answer
  • A pacing calendar is provided to students so they can:
    8·2 answers
  • What is the difference between primary storage,secondary storage and offline storage what type of storage can be
    6·2 answers
  • ​A(n) ________ database makes it possible to store information across millions of machines in hundreds of data centers around th
    14·1 answer
  • Stress results from _______. A. Outside stimulus b. Internal stimulus c. Outside calm d. Internal calm
    12·2 answers
  • Differences between electromechanical era and electronic era in point.<br>PLZ HELP​
    6·1 answer
  • Two technicians are discussing a parasitic load test. Technician A says that the parasitic load is measured with an ammeter Tech
    13·1 answer
  • The process of combining rows and columns in a table is called _____.
    8·1 answer
  • Autumn suffers from nocturnal dyspnea. This term describes a breathing condition but using the prefixes to translate, it means:
    5·1 answer
  • What Is entered into the system as input?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!