## Problem Statement:

In the Sum of non-primes in Python, we are given a list of numbers, we need to find the sum of non-prime numbers in the given list.

## Code for Sum of non-primes in Python:

```
# declaring list of numbers
numbers = [2, 35, 5634, 12, 354, 87, 34, 123, 43, 67, 34, 98, 13, 11]
# declaring empty list
non_primes =[]
# declaring for loop
for i in numbers:
flag=1
# checking whether a number is prime or not
for j in range(2, i//2+1):
if i%j==0:
flag=0
break
# storing non prime numbers only
if flag==0:
non_primes.append(i)
# printing sum of non primes
print(sum(non_primes))
```

## Output:

## Explanation:

We simply stored non-prime numbers in an empty list by filtering the original list containing all numbers. At last, we simply printed the sum with the help of ** sum()** method(a built-in method for list) in Python. Please comment for any queries

**Also Read:**

- Hyphenate Letters in Python
- Earthquake in Python | Easy Calculation
- Striped Rectangle in Python
- Perpendicular Words in Python
- Free shipping in Python | Assignment Expert
- Raj has ordered two electronic items Python | Assignment Expert
- Team Points in Python | Assignment Expert
- Ticket selling in Cricket Stadium using Python | Assignment Expert
- Split the sentence in Python | Assignment Expert
- String Slicing in JavaScript | Assignment Expert
- First and Last Digits in Python | Assignment Expert
- List Indexing in Python
- Date Format in Python | Assignment Expert
- New Year Countdown in Python | Assignment Expert
- Add Two Polynomials in Python | Assignment Expert
- Sum of even numbers in Python | Assignment Expert
- Evens and Odds in Python | Assignment Expert
- A Game of Letters in Python | Assignment Expert
- Sum of non-primes in Python | Assignment Expert
- Smallest Missing Number in Python | Assignment Expert
- String Rotation in Python
- Secret Message in Python | Assignment Expert
- Word Mix in Python | Assignment Expert
- Single Digit Number in Python
- Shift Numbers in Python | Assignment Expert
- Weekend in Python | Assignment Expert
- Shift Numbers in Python | Assignment Expert
- Temperature Conversion in Python | Assignment Expert
- Special Characters in Python | Assignment Expert
- Sum of Prime Numbers in the Input in Python
- Numbers in String-1 in Python
- Replace Elements with Zeros in Python | Assignment Expert
- Remove Words in Python | Assignment Expert
- Print Digit 9 in Python | Assignment Expert