---
# System prepended metadata

title: Prime numbers

---

# Prime numbers

Write a function that returns prime number smaller than N

Prime numbers: 2, 3, 5, 7, 11


```python=3.8
def get_primes(N):
    #return all prime number < N
    result =[]
    
    def is_prime(n):
        if n== 2 :
            return True
        #check if n is prime number
        for i in range(2, int(n/2)):
            if n% i ==0:
                return False
        return True
    
    for i in range(N):
        if is_prime(i):
            result.append(i)
    return result