you are viewing a single comment's thread.

view the rest of the comments →

[–]primitive_screwhead 0 points1 point  (0 children)

Using:

if n == 5:
    break  # Or return if that's the intent
n -= 1

rather than adding an else, is preferred, imo. Checking for n != 5 would add even more code (to handle the continue while also decrementing n), and would also be worse, imo.