Skip to content
Snippets Groups Projects
Commit af70a346 authored by Christopher Bohn's avatar Christopher Bohn :thinking:
Browse files

Fixed bug in tail recursion example.

A misplaced right-paren checked for the length of a boolean and then
conditioned an `if` statement on that length.
parent a07733ed
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ def slightly_better_iterator(a_list): ...@@ -10,7 +10,7 @@ def slightly_better_iterator(a_list):
def poorly_defined_adder(a_list): def poorly_defined_adder(a_list):
if len(a_list == 0): if len(a_list) == 0:
return 0 return 0
else: else:
return a_list[0] + poorly_defined_adder(a_list[1:]) return a_list[0] + poorly_defined_adder(a_list[1:])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment