Mar-17-2022, 06:54 AM
(This post was last modified: Mar-17-2022, 06:55 AM by alexfrol86.)
Hello! I try to solve the equation sqrt(x**2 + y**2) by brute force within the range [0, 10]. Please help me make this code work
def eq(x, y):
i = sqrt(x**2 + y**2)
return sqrt(x**2 + y**2)
eps = 0.001
step = eps / 2
i = (0, 10, step)
for x in range (-10, 10, step):
for y in range (-10, 10, step):
while eq(x, y) == i:
print(f"x = {x}, y = {y}")

