Does your is_prime function take exactly one argument (an integer)? Your code threw a "'int' object is not iterable" error


#1

def is_prime(x):
    for n in x:
        if n % 2 == 0 or n < 2:
            return False
        elif n == 2:
            return True
        else:
            return True

How can i solved it plz help me


#2

x is an integer, which is not iterable. A range from 2 to x is iterable.

So far, your code only elliminates even numbers.