To really understand this, I would express it in a declarative, sort-of logical form.
Here's your code:
1: if len(string) == 0: return ''
2: else: return reverse_strings(string[1:]) + string[0]
I'll call the first element of a string (string[0]) its head and the remainder (string[1:]) its tail. If a string is only 1 character long, we consider its tail to be the empty string. In terms of that vocabulary, here are the rules for what it means to reverse a string:
- The empty string reversed is the empty string.
- Any other string reversed is the reversed version of its tail, followed by its head.
In the case of, for example, abcd, we apply rule 2 since rule 1 doesn't apply:
abcd reversed is bcd reversed, followed by a.
Ok, what's bcd reversed? Well, we can apply the same rule:
bcd reversed is cd reversed, followed by b.
and down the chain:
cd reversed is d reversed, followed by c,
d reversed is '' reversed, followed by d,
'' reversed is '', by rule 1, because it is the empty string.
Going back up this list, you get:
'' followed by d followed by c followed by b followed by a
which is dcba, which is what we wanted!
Wrapping your head around recursion isn't easy. Try to solve some other problems with it or do some exercises that require it; this kind of practice really helps understanding.