Python Program to Multiply Two numbers

Write a Python program to multiply two numbers. This example accepts two integer values and calculates the product of those two numbers.

num1 = int(input("Please Enter the First Number to Multiply  = "))
num2 = int(input("Please Enter the second Number to Multiply = "))

mul = num1 * num2
print('The Result of Multipling {0} and {1} = {2}'.format(num1, num2, mul))
Python Program to Multiply Two numbers

Python program to multiply two floating point numbers.

num1 = float(input("Please Enter the First  = "))
num2 = float(input("Please Enter the second = "))

mul = num1 * num2
print('The Result of Multipling {0} and {1} = {2}'.format(num1, num2, mul))
Please Enter the First  = 17.89
Please Enter the second = 28.56
The Result of Multipling 17.89 and 28.56 = 510.9384

This program helps to multiply two numbers using functions

# using Functions

def multiplyTwoNum(a, b):
    return a * b

num1 = int(input("Please Enter the Firs  = "))
num2 = int(input("Please Enter the second = "))

mul = multiplyTwoNum(num1, num2)
print('The Result of Multipling {0} and {1} = {2}'.format(num1, num2, mul))
Please Enter the First  = 12
Please Enter the second = 19
The Result of Multipling 12 and 19 = 228

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.