input: Write a python function to calculate the sum of prime numbers within a given range.
  assert prime_sum(10, 20) == 60
  assert prime_sum(1, 10) == 17
  assert prime_sum(20, 30) == 52
output: def prime_sum(start, end):
      def is_prime(n):
          if n <= 1:
              return False
          for i in range(2, int(n**0.5) + 1):
              if n % i == 0:
                  return False
          return True
  
      return sum(n for n in range(start, end + 1) if is_prime(n))