In this tutorial, we are shown the Write a Python program to multiply two numbers Numbers. Here is The Example to multiply the two numbers.and more easy to run this code for any IDE.
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))
Output
Please Enter the First Number to Multiply = 8
Please Enter the second Number to Multiply = 10
The Result of Multipling 8 and 10 = 80
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))
OutPut
Please Enter the First = 50
Please Enter the second = 90
The Result of Multipling 50.0 and 90.0 = 4500.0
Python program to multiply two numbers 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))
Output
Please Enter the Firs = 80
Please Enter the second = 1000
The Result of Multipling 80 and 1000 = 80000