Questions about the specifics of strings

I keep getting “Failed to test your code” for the first section.
I’ve defined the code:

def repeat_stuff(stuff, num_repeats):
print(" ")

but I am not allowed to continue onto the next section. Am I doing something wrong?

I keep getting the same error for “Control flow” lesson 9.

I’ve even copied in the solution code, and it still tell me that “Failed to test your code” and just doesnt wan’t to move on.

Yes, it is. When you concatenate it 10 times, it would make sense.

You also have to make sure the R in Row is capitalized. I just spent an hour trying to figure out why it wasn’t working even though the console showed “row 3” XD…

I got it!!!

def repeat_stuff(stuff, num_repeats):
‘indented here’ print()
repeat_stuff("Row ", 3)

That’s it! I had originally had an ‘=’ sign after the ‘repeat_stuff’ of line 3. Another key factor was to make sure there is a space after the ‘Row’ of the "Row " on line 3. --> ‘Row_3’.
Hope this helps someone.

Thank you!

This exercises is awful…

2 Likes

Make sure to capitalize the R in "Row "…

def repeat_stuff(stuff,num_repeats=10):
return repeat_stuff

repeat_stuff("Row ",10)

This is not working. Does anyone know why it will not print ‘Row Row Row’

That line can be wrapped in a print statement.

print ( ... )

def repeat_stuff(stuff, number_repeats):
print()

repeat_stuff("Row ", 3)

Remember it is OUTSIDE of the function, so there is no space before repeat_stuff in the line 4.

hmm i think its cause you’re missing the full stop at the end.

lyrics = repeat_stuff("Row ", 3) + "Your Boat. "

also don’t miss the space after row .

1 Like