input: Write a python function to calculate the sum of prime numbers below a given number n.
  assert sum_of_primes(10) == 17
  assert sum_of_primes(20) == 77
  assert sum_of_primes(2) == 0
  assert sum_of_primes(1) == 0
output: def sum_of_primes(n):
      def is_prime(k):
          if k <= 1:
              return False
          for i in range(2, int(k**0.5) + 1):
              if k % i == 0:
                  return False
          return True
  
      return sum(i for i in range(2, n) if is_prime(i))