Q:

getting all possible cases in Python3

Say I have a list of n elements, and each element consists of list of 0 or more integers, I want to get all possible combinations.  
This is my list:
[[0], [1, 6], [2, 3], [2, 3], [], [4]]

This is expected output:
[0, 1, 2, 2, 4]
[0, 1, 3, 2, 4]
...
[0, 6, 3, 3, 4]

List order should be kept.  That is any combination should be started with 0. 

A:

You are looking for the product of the lists; use itertools.product(), but do filter out empty lists first:
from itertools import product

for combo in product(*filter(None, yourlist)):
    print(combo)

filter(None, ...) removes any empty elements. 
Demo:
>>> from itertools import product
>>> yourlist = [[0], [1, 6], [2, 3], [2, 3], [], [4]]
>>> for combo in product(*filter(None, yourlist)):
...     print(combo)
...
(0, 1, 2, 2, 4)
(0, 1, 2, 3, 4)
(0, 1, 3, 2, 4)
(0, 1, 3, 3, 4)
(0, 6, 2, 2, 4)
(0, 6, 2, 3, 4)
(0, 6, 3, 2, 4)
(0, 6, 3, 3, 4)

