def is_prime_numbers(n): for i in range(2,n//2+1): if(n%i==0): return(0) return(1) lower_range = int(input("Enter your lower number:")) upper_range = int(input("Enter your upper number:")) prime_numbers_list = [] sum_of_prime_numbers = 0 for i in range(lower_range, upper_range+1): if(is_prime_numbers(i)): prime_numbers_list.append(i) print('The sum of prime numbers:', sum(prime_numbers_list))