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.
I'm sure you've solved this by now, but just in case...
You know that there can't be more WUBs than the length of the given title / 3 (because WUB takes up three characters). Can you replace the groups of WUBs with a single space if you know how many there are?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Much appreciated.
Oooooh, my original code was actually returning None (I ran it in another editor so I could see specifically what it WAS returning). That's even more curious. Why would it return None if it knows what the counter is? (Don't get me wrong, I know now to make sure I'm returning along the way, but that's still super confusing)
Ahhh, ok. I thought I was changing my return line, not the earlier line calling persistence. That definitely fixed it. Thank you. (and this is now a point I'm not likely to forget anytime soon)
I'm not 100% clear why that's needed though, because how is the program itself able to know what the counter is if I print out that variable, but it goes all wonky when I try to return it if I wasn't recursively returning it along the way? Real Python has a whole page on recursion, but they aren't really explaining the why there either, so my curiousity still abounds.
When I change the last line to return persistence(first_number, counter), I get an infinite loop
The downvote was because you were only telling me I was doing it wrong, not helping me to understand how to do it right. I'm 8th kyu, so you can see that I just started and don't have the programming skill that you have. Don't you remember how intimidating everything seemed to you when you started? Wouldn't you have preferred someone politely pointing out what to do or giving a example of what that would look like? You took the time to make an initial response, so why not offer a little more help to someone who is clearly struggling.
I understand that there are probably better ways to solve this challenge (there usually always are), but the fact remains that I am returning the correct number every time, but the test cases are saying that I'm not for every test except the one that should be returning a 0. I added a print line to verify what number I am returning. It says it should be getting a 3 and I'm returning a 3. Why would that be failing the test case?
Are you saying that when I return counter, it's overriding the current value and resetting it back to 0? How do you prevent that?
This comment is hidden because it contains spoiler information about the solution