File: sum_cubes.py
Complete the function sum_cubes
, which takes an integer :math:n
and computes the sum
Do not use loops nor list comprehensions.
File: sublists.py
A sublist of a list lst
is a list that contains some (possibly all or none) of the elements of lst
, in the same order. For example, the following are all the sublists of ['A', 'B', 'C']
:
[] ['A']
['C'] ['A', 'C']
['B'] ['A', 'B']
['B', 'C'] ['A', 'B', 'C']
You will complete the function sublists
, which takes a list of values and returns a list of all sublists of the input.
To figure out how to solve the sublists problem recursively, focus on the example above, which shows the solution to the sublists problem on the input ['A', 'B', 'C']
. Identify how the first column above is the solution to the sublists problem on a simpler input. Then, find a relationship between the first column and the second column.