In this kata you will create a function to check a non-negative input to see if it is a prime number.

The function will take in a number and will return True if it is a prime number and False if it is not.

A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.

### Examples

Difficulty: introductory

Starter code:

def is_prime(n):
	

Solutions:
import math
def is_prime(n):
    if n < 2: 
        return False
    return all(n % i for i in range(3, int(math.sqrt(n)) + 1, 2))

def is_prime(n):
    'Return True if n is a prime number otherwise return False'
    # 0 and 1 are not primes
    if n < 2: 
        return False
    
    # 2 is only even prime so reject all others
    if n == 2: 
        return True
        
    if not n & 1: 
        return False
    
    # test other possiblities
    for i in range(3, n):
        if (n % i) == 0 and n != i: 
            return False
  
  
    return True

def is_prime(num):
    'Return True if n is a prime number otherwise return False'
    return num > 1 and not any(num % n == 0 for n in range(2, num))

from math import sqrt

def is_prime(n):
    if n < 2:
        return False
    elif n == 2:
        return True
    elif n % 2 == 0:
        return False
    else:
        for i in range(3, int(sqrt(n)) + 1, 2):
            if n % i == 0:
                return False
        else:
            return True

def is_prime(n,i=2):
    if (n <= 2):
        return True if(n == 2) else False
    elif (n % i == 0):
        return False
    elif (i * i > n):
        return True
    return is_prime(n, i + 1)