Question: In python The lines of code for the following function are out of order. Put the code in the correct order. Ignore tabbing. The below
In python
The lines of code for the following function are out of order. Put the code in the correct order. Ignore tabbing.
The below comments explain how the function should work.
# This function computes the GCD. # The GCD(a,b) is the largest number # that divides both a and b evenly # Mathematically, it is defined below. # gcd(a,0)=a# gcd(a,b)=gcd(b,a%b) # for example gcd(30, 20) = 10 since 30/10=3 and 20/10=2
return a
b=y
a=b
def gcd(a,b):
while b > 0:
x = a // b
y = a-x*b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
