Aug-21-2017, 07:48 AM
Hi all ! Here is a multiplication table. The first display is good but not square. The second display is square but plenty of apostrophes and commas, which I wish to delete. Can I have a square beautifull display ?? Tell me please what is a "python icon". Thanks
# trial.py from pprint import pprint P = [[x * y for y in range(1, 10)] for x in range(1, 10)] pprint(P) for i in range(len(P)): for j in range(len(P)): if len(str(P[i][j])) == 1: P[i][j] = " " + str(P[i][j]) else: P[i][j] = str(P[i][j]) for x in range(len(P)): print(P[x])