PA1

Source code:

# Ask for input and conversion
numStr=input(‘Please enter a number: ‘)
n=int(numStr)
# Repeatly calculate to get approximate number
guess=n/2
c=0
while c<5:

temp=float(n/guess)
guess=(guess+temp)/2
c=c+1

# Print output
print(‘The square root of’, n, ‘ is’, “%.2f” % guess)