Creating a dictionary with list of lists in Python,{d[0]: (' '.join(d[1:]) if d[1:] else 0) for d in data}