Using for loop and range() function you can print a table of any number in Python. And if you want to take input from the user then use the input method.
A program to print a table of any number in Python
Simple example code using a print statement, print the multiplication tables of the given number.
n = int(input("Enter the number: "))
for i in range(1, 11):
print(n, "x", i, "=", n * i)
Output:
Do comment if you have any doubts or suggestions on this Python table number code.
Note: IDE: PyCharm 2021.3.3 (Community Edition)
Windows 10
Python 3.10.1
All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.