Python print 99 multiplication table


Answers ( 1 )


    This question is asking how to print a multiplication table, commonly known as the "99 table," using Python.

    In Python, this can be accomplished using nested loops. The outer loop can iterate through the numbers 1 to 9 (inclusive), and the inner loop can iterate through the numbers from 1 to the current number of the outer loop. In each iteration, the two numbers are multiplied, and the result is printed in a formatted way to display the multiplication table.

    Here's an example of how you can do this in Python:

    for i in range(1, 10):  # Outer loop for each row (1 to 9)
        for j in range(1, i + 1):  # Inner loop for each column
            print(f"{j}x{i}={j*i}", end="\t")  # Print the multiplication and use tab for spacing
        print()  # Print a newline at the end of each row

    This script will output the multiplication table in a formatted way, where each row starts from 1x current row number and goes up to current row number x current row number. The end="\t" in the print statement ensures that the columns are separated by a tab for better readability.

Leave an answer