![]() |
|
|
+ Search |
![]()
|
May 10th, 2006 15:27
stephen brown, Satish Mishra,
This can be done with nested loops or list comprehensions: >>> a = range(3) >>> b = 'abc' >>> [(x, y) for x in a for y in b] [(0, 'a'), (0, 'b'), (0, 'c'), (1, 'a'), (1, 'b'), (1, 'c'), (2, 'a'), (2, 'b'), (2, 'c')] >>>