How to print the 99 multiplication table in Python?

You can use nested loops to print the multiplication table of 99, the code is as follows:

for i in range(1, 10):
    for j in range(1, i+1):
        print(f"{j} * {i} = {i*j}", end="\t")
    print()

In this code, the outer loop controls the number of rows, while the inner loop controls the number of columns in each row. We use range(1, 10) to control the number of rows from 1 to 9. Within the inner loop, range(1, i+1) controls the number of columns in each row from 1 to i. We use the print() function to output the result of each row, and set the space between each result to a tab with end=”\t”.

By running the above code, you will be able to print the multiplication table of 99.

bannerAds