title: Generating a list of lists whose elements come from another list (Python)
body: <p>How can you generate a list of lists, with varying sizes, whose elements are from another list, say, <code>a = [1,2,3]</code>? Ex: If I choose length of the lists to be 2, then I should get <code>[[1,1],[1,2],[1,3],[2,1],[2,2],[2,3],[3,1],[3,2],[3,3]]</code>.</p>