Print Multiplication Series
Print a multiplication series for a number in a compact single-line format.
BeginnerTopic: Loop Programs
Python Print Multiplication Series Program
This program helps you to learn the fundamental structure and syntax of Python programming.
# Program to print multiplication series for a number
num = int(input("Enter a number: "))
limit = int(input("Enter limit: "))
terms = []
for i in range(1, limit + 1):
terms.append(f"{num}x{i}={num * i}")
print(" , ".join(terms))Output
Enter a number: 3 Enter limit: 5 3x1=3 , 3x2=6 , 3x3=9 , 3x4=12 , 3x5=15
Understanding Print Multiplication Series
We build a list of formatted multiplication terms and then join them into a single string for compact display.
Note: To write and run Python programs, you need to set up the local environment on your computer. Refer to the complete article Setting up Python Development Environment. If you do not want to set up the local environment on your computer, you can also use online IDE to write and run your Python programs.