SyntaxFix
Write A Post
Hire A Developer
Questions
Could it be more useful for you to use the length of the list len(n) to inform your decision rather than checking n[i] for each possible length?
len(n)
n[i]