Anonymous Anonymous - 3 months ago
132 0

No description

Python

multiplicationTableOneToNine

#Written by khay
#Python3

oneToNineList = [[i * j for i in range(1, 10)] for j in range(1, 10)]
print("* | " + " ".join(str(number).ljust(4, " ") for number in oneToNineList[0]))
print("-" * 46)
for list in range(1, len(oneToNineList) + 1):
    print("{} | ".format(list) + " ".join(str(number).ljust(4, " ") for number in oneToNineList[list-1]))