2
I’m trying to put a command line that does division from subtraction into a dictionary but would be causing error, would know where I’m going wrong?
x = float(x)
y = float(y)
num = 0
if y != 0:
if (x>0) and (y>0):
def Divisão (x, y):
while (x >= y):
x = x - y
num = num + 1
return num
print(f"Seu resultado é: {Divisão(x, y)}")
elif (x>0) and (y<0):
y = -(y)
def Divisão(x, y):
while (x>0):
x = x - y
num = num - 1
return num
print(f"Seu resultado é: {Divisão(x, y)}")
elif (x<0) and (y>0):
x = -(x)
def Divisão(x, y):
while (x>0):
x = x - y
num = num - 1
return num
print(f"Seu resultado é: {Divisão(x, y)}")
else:
x= -(x)
y= -(y)
def Divisão (x, y):
while (x>0):
x = x - y
num = num + 1
return num
print(f"Seu resultado é: {Divisão(x, y)}")
Greetings Xiruxim, if any of the answers answered your question, consider accepting it. See How and why to accept an answer? and What should I do if someone answers my question?
– Woss