So, I tried running this code in both Jupyter and Spyder. It gave me the correct output in the Jupyter notebook but showed be TypeError: 'str' object is not callable in Spyder. Please explain why is it happening. Also, I tried writing float(guess) in the call function but still didn't work.
x = 25
epsilon = 0.01
step = 0.1
guess = 0.0
while abs(guess**2-x) >= epsilon:
if guess <= x:
guess += step
else:
break
if abs(guess**2 - x) >= epsilon:
print('failed')
else:
print('succeeded: ' + str(guess))