Posts: 232
Threads: 2
Joined: Sep 2017
Oct-26-2018, 06:56 PM
(This post was last modified: Oct-26-2018, 06:57 PM by gruntfutuk.)
It would be better if you posted your code on this forum rather than in a link.
I have looked at your code. Please rewrite and use meaningful variable names. It is very hard to follow your intentions when you use cryptic / single-character variable names.
A few observations:
- I am confused by:
if i != length: break
as surely that means loop will only execute once?
- you also initialise i to zero but then use it as the counter in a for loop
range()
starts at zero by default
- you are in danger of index going out of range with the i+1 when you are counting to the last item
- you are incrementing i after the while loop, why? (You don't seem to use it)
I am trying to help you, really, even if it doesn't always seem that way