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.
nevermind im sorry fixed the indentation and it worked! ty
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
i understand hiding the comment, but atleast provide input seeing as now i cant see my own comment
Python:
def reverse(str):
if str == "":
return str
else:
return reverse(str[1:]) + str[0]
print (reverse('Hello World'))
prints hello world backwards but still gives error:
Randomly generated tests
✔ Test Passed
✘ 1 should equal 2
I have no idea what this means or how to fix it. Any help/suggestions?
i am getting the same error and have no idea what it means or how to fix it, my first attempt was this:
def reverse(str):
n = 11
return str[::-1]
reverse('Hello World')
got the same error you did. Second attempt was this
def reverse(str):
if str == "":
return str
else:
return reverse(str[1:]) + str[0]
print (reverse('Hello World'))
now it actualyl prints hello world backwords but says:
Randomly generated tests
✔ Test Passed
✘ 1 should equal 2
not sure where im wrong