|   | 1 |  initial version  | 
You can use itertools.product, as follows:
sage: A = [[1, 2], [3], [4, 5]]
sage: import itertools as itl
sage: list(itl.product(*A))
[(1, 3, 4), (1, 3, 5), (2, 3, 4), (2, 3, 5)]
 Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
 
                
                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.