Automate the following task to be completed on Python
Determine if a given number is prime or not
def is_prime(num):
    if num <= 1:
        return False
    for i in range(2, num):
        if num % i == 0:
            return False
        return True