x-1 in range? range doesn't include the stop value (
x), no need to also subtract one.
uhm.. i would the special cases first, and then the loop
In the loop, the moment a return keyword is reached, the function (thus the loop) ends. this currently happens in the first run of your loop (either if is true, or else will run). you only want to return True after the loop has finished running (hint: indention)