table_data = [ ['a', 'b', 'c'], ['aaaaaaaaaa', 'b', 'c'], ['a', 'bbbbbbbbbb', 'c'] ] for row in table_data: print("{: >20} {: >20} {: >20}".format(*row))
Here is what the above code is Doing:
1. We have a list of lists called table_data.
2. We iterate through each list in table_data.
3. We print the elements of each list in table_data.
4. We use the string format method to right justify the elements of each list.