When we divide an integer (D) by another integer (E), we obtain a quotient (Q) and remainder ®. Q represents the number of times that E occurs in D; in simpler terms, Q is the number of parts, of size E, that D can be broken into. Once all of these parts are taken out of D, the remaining part is the remainder.
By this point, you should have realized that the quotient can be found by repeatedly subtracting E from D, and recording the number of times that this subtraction is performed.
def Divide(D,E): R = D Q = 0 while R >= E: R = R - E Q += 1 return Q D = 11 E = 4 print("Quotient from our function: ",Divide(D,E)) print("Actual Quotient: ", D // E)
View all Courses