I am attempting to find for which x and y values in the range(-10,10) the equation is satisfied and if no solution is found I am trying to output "No solution".
However, when attempting to output "No solution" I am either getting "No Solution" in every single iteration of it outputs "No solution" at the end regardless of if the for-loop is satisfied.
I am having trouble figuring out how to add in my print statement for when there is no solution.
Here is what I have thus far:
''' Read in first equation, ax + by = c '''
a = int(input())
b = int(input())
c = int(input())
''' Read in second equation, dx + ey = f '''
d = int(input())
e = int(input())
f = int(input())
for x in range(-10,10):
for y in range(-10,10):
if ((a*x) + (b*y)) == c and ((d*x) + (e*y)) == f:
print(x, y)
break