Programming Assignment 1

This is the first programming assignment.

In this program, we need to finding a way to get the square root of the number the user inputs.

———————————————

inputStr = raw_input(“Input a number: “)

x = int(inputStr)

if x < 0:
print “Undefined”
else:
inputStr2 = raw_input(“Input a guess: “)

y = int(inputStr2)

z = (y + x/y) / 2

print z

“x = number”
“y = guess”
“z = equation answer”

————————————