I have the following simple function:
def divide(x, y): quotient = x/y remainder = x % y return quotient, remainder x = divide(22, 7) <
def divide(x, y): quotient = x/y remainder = x % y return quotient, remainder x = divide(22, 7)
You are essentially returning a tuple, which is an iterable we can index, so in the example above:
print x[0] would return the quotient and
print x[0]
print x[1] would return the remainder
print x[1]