Python Multiplication – Arithmetic Operator
Python Multiplication Operator takes two operands, one on the left and other on the right, and returns the product of the these two operands.
The symbol used for Python Multiplication operator is
Following is the syntax of Python Multiplication Arithmetic Operator.
result = operand_1 * operand_2
operand_2 are numbers and the result is the product of
Example 1: Multiplication of Numbers
In this example, we shall take two integers, multiply them, and print the result.
a = 10 b = 12 result = a * b print(result)
Chaining of Multiplication Operator
You can multiply more than two numbers in a single statement. This is because, Multiplication Operator supports chaining.
a = 10 b = 12 c = 5 d = 63 result = a * b * c * d print(result)
Example 2: Multiplication of Floating Point Numbers
Float is one of the numeric datatypes. You can compute the product of floating point numbers using Python Multiplication operator. In the following example, we define two floating point numbers, and find their product.
a = 10.5 b = 12.9 result = a * b print(result)
Example 3: Multiplication of Complex Numbers
You can find the product of complex numbers. In the following example program, we shall take two complex numbers and find the result of their multiplication.
a = 1 + 8j b = 3 + 5j result = a * b print(result)
In this tutorial of Python Examples, we learned what Python Multiplication Arithmetic Operator is, how to use it to find the product of two or more numbers.