I am currently working on a project and I need help on converting a list to a table. I have figured it out one way but there has to be a shorter and a cleaner way of doing it an
Try to use one of many popular packages available to print tabular o/p. My suggestion is to use tabulate
from tabulate import tabulate
sales_persons_list = list('ABCDE')
sales_amounts_list = list('12345')
print (tabulate(zip(sales_persons_list, sales_amounts_list), tablefmt="plain"))
Output
A 1
B 2
C 3
D 4
E 5