I'm a little confused as to why the first return(True) on line 6 of my code below works...
Why don't I need an else statement prefixing the return(True) statement? Does python automatically assume an else statement in code structures like this?
Any and all feedback will be greatly appreciated.
def is_prime(x): if x > 2: for n in range(2, x): if x % n == 0: return(False) return(True) elif x == 2: return(True) else: return(False)