

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Recursion
incomplete
2: Recursion Review
incomplete
3: Zipmap
incomplete
4: Recursion Quiz
incomplete
5: Nested Sum
incomplete
6: Recursion Review
incomplete
7: Recursion on a Tree
incomplete
8: Dangers of Recursion
incomplete
9: Recursion Practice
incomplete
10: Recursion Practice
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
ā xkcd
I hate explaining jokes, but in case you don't get the comic: The joke is that the characters within the Dungeons and Dragons game are also playing their own Dungeons and Dragons game. Maybe their characters' game of DnD also has characters playing DnD, and so on, recursively forever.
def print_chars(word: str, i: int) -> None:
if i == len(word):
return
print(word[i])
print_chars(word, i + 1)
print_chars("Hello", 0)
# H
# e
# l
# l
# o