What is wrong with this code


#1



Replace this line with your code.


#2

def is_prime(x):
if x==0 or x==1:
return False
elif x==2 or x==3:
return True
elif x>3:
for i in (2,x-1):
if x%i==0:
break
return False

    else:
        return True

#3

you need only one if

if x < 2:

and you don't need break


#4

It works for all numbers less than 9. It returns wrong output when 9 is passed as an argument.
I wanted to break the loop if it's non prime and hence return false (which is outside the loop).
I thought if it is a prime, then after the normal execution of the loop, else return false would executed.
FYI- I have executed with alternate ways using counter variable. But I want to make this above logic work. Please help me!!