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]
4 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]4 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
Is ubisoft still making assassins creeds on xbox 360
BabaBlast [244]
I don’t think so. Not sure though
8 0
3 years ago
Read 2 more answers
Select the correct answer.
Mekhanik [1.2K]
The best answer is A
5 0
3 years ago
Read 2 more answers
How did hitles rules in nazi germany exemplify totiltarian rule?
ddd [48]

Answer:

hope this helps if not srry

7 0
3 years ago
How do a tubercolosis test work?
Soloha48 [4]
The answer is If a skin or blood TB test is posittive, your doctore mau give you a chest X-ray. They will look for abnormal spots on your lungs or any changes caused by TB.
4 0
3 years ago
In Python write a program that reads a list of integers into a list as long as the integers are greater than zero, then outputs
Lilit [14]

Answer:

ansList =input().split() #get input and split it by space

ansList = [int(i) for i in ansList if int(i)>0] #turn string to integer,and get all positive integers

print(ansList)

Explanation: I think this would work for you. I leace comments in the answer.

3 0
2 years ago
Other questions:
  • Helena purchased a security software package to protect her new laptop against threats such as spyware and computer viruses. she
    14·1 answer
  • Suppose your name was Alan Turing. Write a statement that would print your last name, followed by a comma, followed by a space a
    10·1 answer
  • In the cis configuration, the methyl groups are placed _____.
    8·2 answers
  • Which of the following countries have mixed-market economy
    5·1 answer
  • A network technician is attempting to add an older workstation to a Cisco switched LAN. The technician has manually configured t
    11·1 answer
  • ANSWER ASAP!!!!!
    10·2 answers
  • Please help. will give u brainliest!! khan academy computers and the internet!!
    12·1 answer
  • Select the correct word to complete the sentence.
    8·1 answer
  • A ____________ is a collection of commands given a name.
    11·1 answer
  • If a citation has a volume, title, and page numbers, it is a:
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!