-4
def func(x=1, y=3):
if x == y:
return "Igualdade."
else:
return "Desigualdade."
if x > y or x < y:
return True
if True == x > y:
return x
else:
return y
if x < y:
return (y - x) == c
if c + x == y:
return "Agora está igual!"
else:
return "Afinal, não está igual."
It’s already solved. Thank you all for your help, here’s how the code looks. Note: I took it out of function.
x = 1
y = 3
if x == y:
print("Igualdade.")
else:
print("Desigualdade.")
if x > y or x < y:
print(True)
if True == x > y:
print("x", x)
else:
print("y", y)
if x < y:
print(y - x)
if y - x + x == y:
x = y - x + x
if x == y:
print("Agora está igual!")
I moved a bit more and now adding 'Else', 'and' and 'not'.
if x == y:
print("Igualdade.")
else:
print("Desigualdade.")
if x > y and not x < y:
print("x", x)
else:
print("y", y)
if x < y:
print(y - x)
if y - x + x == y:
x = y - x + x
if x == y:
print("Agora está igual!")
Other option.
if x == y:
print("Igualdade.")
else:
print("Desigualdade.")
if x > y and not x < y:
print("x", x)
else:
print("y", y)
if x > y:
y = (x - y) + y
else:
x = (y - x) + x
if x == y:
print("Agora está igual!")
Could explain what you’re trying to do?
– Danizavtz
Hello, friend, I was wanting to return the message, at the end of the code. Where it says, "After all, it’s not the same". But I already got it. Instead of explaining, I’ll post the code here for you to see how it turned out.
– Brunno Silva
x = 1 y = 3 if x == y: print("Equality.") Else: print("Inequality.") if x > y or x < y: print(True) if True == x > : print("x", x) Else: print("y", y) if x < y: print(y - x) if y - x + x == y: x = y - x + x if x == y: print("Now it’s the same!")
– Brunno Silva
Very good, thank you.
– Danizavtz
Thank you. Hug friend.
– Brunno Silva