Skip to content

birc-ctib/powerset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Power-sets

Try to implement the power function in src/powerset.py

def power(x: list[Any]) -> list[list[Any]]:
    """
    Compute the power-set of x.

    Returns the power-set of x as a list of lists.

    >>> power([])
    [[]]
    >>> power([1])
    [[], [1]]
    >>> power([1, 2])
    [[], [1], [2], [1, 2]]
    """
    ... # missing code here!