Question: Task 1: Write a function gcd(a, b) that takes two integers and uses the Euclidean algorithm to find their greatest common divisor. * INPUT: a

Task 1: Write a function gcd(a, b) that takes two integers and uses the Euclidean algorithm to find their greatest common divisor. * INPUT: a - integer b integer * OUTPUT: the GCD as an integer In [ ]: def gcd(a, b): "returns the god of integers a and b INPUT: a, b - integers OUTPUT: the gcd as an int pass In [ ]: "TESTER CELL" print("Testing gcd(101, 4620) = ", gcd(101, 4620)) print("Expected: 1") print("Testing gcd (2349, 36) = ", gcd(2349, 36)) print("Expected: 9")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
