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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!