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