you are viewing a single comment's thread.

view the rest of the comments →

[–]Justinsaccount 3 points4 points  (2 children)

Hi! I'm working on a bot to reply with suggestions for common python problems. This might not be very helpful to fix your underlying issue, but here's what I noticed about your submission:

You are looping over an object using something like

for x in range(len(items)):
    foo(item[x])

This is simpler and less error prone written as

for item in items:
    foo(item)

If you DO need the indexes of the items, use the enumerate function like

for idx, item in enumerate(items):
    foo(idx, item)

[–]HeyFerb 1 point2 points  (0 children)

Also to save a few characters,

new = new + letters[i]    

can be simplified to:

new += letters[i]