Write a Python program to compute the greatest common divisor (GCD) of two numbers. The program should take two integers as input and output the GCD.
Example:
Input: 54, 24
Output: 6
The GCD of two numbers is the largest number that divides both of them without leaving a remainder. One way to compute it is by using the Euclidean algorithm.
def gcd(a, b):
while(b):
a, b = b, a % b
return a
print(gcd(54, 24)) # Outputs: 6
NOTEOwing to browser caching, any code input into the Trinket IDE might carry over across page refreshes or when transitioning between different questions. To commence with a clean slate, either click on the 'Reset Button' found within the IDE's Hamburger icon (☰) menu or resort to using Chrome's Incognito Mode.