#a=divident b=divisor q=quotient r=remainder (a = qb + r)
def euclid(a,b):
while True:
q = 1
while max(a, b) - min(a, b) * (q + 1) > 0:
q += 1
else:
r = max(a, b) - min(a, b) * q
print('a = ', max(a, b), 'and b = ',min(a, b))
euclid(r, min(a,b))
euclid(8, 3)
print(1)
hi, i'm new to coding so it might be a dumb and obvious mistake that i unknowingly made. I created a function to print the divident and divisor in every step of the euclidean algorithm for 8 and 3. However, i found out that the print(1) at the end doesn't seem to execute if i place it under the euclid() function. Additional information: if i change one of the numbers to 0 into my euclid function it doesn't work. Example: euclid(8,0)