Just quickly, still studying, indent another level
Now let's consider anything after
return. Will it ever be reached?
And now we need to look at the core logic of this program. If I were an examiner, which would never happen, but just say... I would toss this paper. Purely on the basis of the first line inside the function.
Unity is not prime because any definition of it would be circular reference. Nobody would state a variable with that value to start a loop in search of primes.
Consider also, the abstract logic: Just because it is not false does that mean it is true? Screwy, I know. If a condition can be evaluated explicitly then it can return whatever. Those opposed to this ought not be seen as opposites, as much as non-candidates.
Along this line of thinking we get to the
else: in the context of
if in a
while statement. THe whole construct is unnecessary. All that needs be is the step on y, which of course would not be 1.
The final outcome will be
True if the while loop completes, otherwise,
False.Scratch some code along these lines and keep us posted!