You can also use list comprehensions to do this, which I guess should work regardless of the Python version:
max_len = max(len(i) for i in a)
[[i[o] if len(i) > o else None for i in a] for o in range(max_len)]
Output:
[[1, 4, 7], [2, 6, 8], [3, None, 9]]
This gives you the flexibility to do whatever you want in case of missing values.
max_len = max(len(i) for i in a)
[[i[o] for i in a if len(i) > o] for o in range(max_len)]
Output:
[[1, 4, 7], [2, 6, 8], [3, 9]]
Alternately, as suggested by @gboffi, you can do the following to save more time:
l = [len(i) for i in a]
[[i[o] for ix, i in enumerate(a) if l[ix] > o] for o in range(max(l))]
list(map(None, *a))
work? – Patrol