Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sum_cubes.py #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions problems/recursion/sum_cubes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def sum_cubes(n):
This function may not use any loops or list comprehensions.
"""

pass
return (n ** 3) + sum_cubes(n - 1)


#############################################################
Expand Down Expand Up @@ -91,4 +91,4 @@ def test_sum_cubes_19():
do_test_sum_cubes(81)

def test_sum_cubes_20():
do_test_sum_cubes(100)
do_test_sum_cubes(100)