Hey guys, i'm new to all of this world so maybe that's a stupid question... but i don't understand why the indentation before the "else" under the "for n in range" is incorrect ???
When i delete the indentation everything works fine, but when i keep it it says that is_prime(3) return "None".
Can anyone try explain me why is it happening?
def is_prime(x): if x<2: return False elif x==2: return True else: for n in range(2,x-1): if x%n==0: return False else: return True