Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Python won't display a single output on seperate lines unless a string spefically contains a line break, you can't tell seperate array elements to display on seperate lines in a single return.
To get the function to return the tower with the breaks already included, you will have to turn it in to a string.
Otherwise when calling the function you will need to do something along the lines of this, to make each floor display on its own line.
Because the string is empty, nothing is displayed in console. That's a subtle hint to pick up on that input could be empty - if other inputs are logged successfully.
By the way, the error message even pinpoints the exact line that fails. Try to think what input would crash your program if you try accessing
0
th element.Can you read, sir? :P
The error message is right in front of you, in console output:
Which means you tried accessing a character that was out of string's bounds. Use
print()
statements and try to debug your code.Because you posted a screenshot containing your code, I have to mark your post a spoiler. Keep in mind that you can post your code here in discourse, using proper formatting (for next time)