input: Write a function to calculate the greatest common divisor of two numbers and return the result. If either number is zero, return the other number as the GCD.
  Assert the function with the following test cases:
  assert gcd(10, 20) == 10
  assert gcd(8, 12) == 4
  assert gcd(25, 25) == 25
  assert gcd(0, 5) == 5
  assert gcd(7, 0) == 7
output: def gcd(a, b):
      while b != 0:
          a, b = b, a % b
      return a