List is a data structure(internal use) and not meant to view like this,as that make no senseπ¦
For view take elements out data structure,then can figure a different way to view it.
For view take elements out data structure,then can figure a different way to view it.
>>> list_a = [1,2,3,4,5] >>> list_b = ['d','h','f','s','g'] >>> lst = [] >>> lst.append([str(i) for i in list_a]) >>> lst.append(list_b) >>> >>> lst [['1', '2', '3', '4', '5'], ['d', 'h', 'f', 's', 'g']] >>> >>> for inner in lst: ... print(' | '.join((f"{word:4}" for word in inner))) ... 1 | 2 | 3 | 4 | 5 d | h | f | s | g
>>> from tabulate import tabulate >>> >>> print(tabulate(lst, tablefmt="fancy_grid")) βββββ€ββββ€ββββ€ββββ€ββββ β 1 β 2 β 3 β 4 β 5 β βββββΌββββΌββββΌββββΌββββ€ β d β h β f β s β g β βββββ§ββββ§ββββ§ββββ§ββββ >>> print(tabulate(lst, tablefmt="pretty")) +---+---+---+---+---+ | 1 | 2 | 3 | 4 | 5 | | d | h | f | s | g | +---+---+---+---+---+ >>> print(tabulate(lst, tablefmt="simple")) - - - - - 1 2 3 4 5 d h f s g - - - - - >>> print(tabulate(lst, tablefmt="youtrack")) | 1 | 2 | 3 | 4 | 5 | | d | h | f | s | g |