Google News
logo
Python Program to Multiplication Operator
In the following example of Python program that demonstrates the use of the multiplication operator `*` :
Program :
# Multiplication operator example
a = 10
b = 5
result = a * b

print("The product of", a, "and", b, "is", result)


In the above program, we first assign the integer values `10` and `5` to the variables `a` and `b`, respectively. We then use the multiplication operator `*` to multiply `a` and `b`, and assign the result to the variable `result`.

Finally, we use the `print()` function to print a message that displays the values of `a`, `b`, and `result`, as well as a message indicating that `result` is the product of `a` and `b`.

When we run the program, it will output the following message :

Output :
The product of 10 and 5 is 50
As you can see, the program correctly multiplies `a` and `b` using the multiplication operator `*`, and displays the result using the `print()` function.