input: Write a function named `gcd` that calculates the greatest common divisor (GCD) of two numbers. The function should perform the calculation using the Euclidean algorithm and return the GCD. Provide the function with two parameters `a` and `b`. If either `a` or `b` is 0, return the other number as the GCD.
  
  assert gcd(10, 20) == 10  
  assert gcd(60, 48) == 12  
  assert gcd(9, 28) == 1  
  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