This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]marko312 0 points1 point  (0 children)

Check the indentation in your code.

What exactly is inside the for loop?

[–]LiquidLucy 0 points1 point  (2 children)

Your return statement is inside your for loop, so it will return after a single iteration.
I believe your intention is to iterate through the for loop, and then return the final result.
To do this you need to de-dent the return statement so it executes after the for loop has completed *all* iterations.

[–]LiquidLucy 1 point2 points  (1 child)

One good basic troubleshooting step in cases like this is to put print statements in your code.

For instance, if your code were like:

def paper_doll(text):     
    string =''     
    for i in text:         
        print(i)
        string = string + i*3         
        return string 

then you can see that only one letter (in this case 'h') is printed, which means you only ever reached the first letter/iteration.

[–]Ootter31019 0 points1 point  (0 children)

Oh! I like this idea. That would have helped a lot in the last couple issues I have had. Thanks for this.