def divide(x,y):
if x <0 or y <= 0:
return 0,0
quotient = 0
while x >= y:
x -= y
quotient += 1
return quotient,x #remainder is in x
def main():
x,y = input("Enter digits separated by comma: ").split(",")
x,y = int(x),int(y)
divide(x,y)
main()
Division of 2 numbers x by y repeatedly, subtracting y from x until y is less than x. For example, x = 11 and y = 4. The quotient is 2 (subtract twice) and remainder is 3 (11-4-4=3).
I am expecting to return tupple of (2,3) but it has been returning me none. I would like to know where I have made the mistake and how I could improve. Thank you in advance!!