Python program to multiply two numbers
- Home
- Calculations
- Python program to multiply two numbers
- On
- By
- 2 Comments
- Categories: Calculations, multiply
Python program to multiply two numbers
Python program to multiply two numbers
In this tutorial, we will discuss Python program to multiply two numbers.
In this topic, we will learn how to multiply two integer number in the Python programming language
multiply two integer numbers
num1=int(input("Enter the first number: ")) #input value for variable num1 num2=int(input("Enter the second number: ")) #input value for variable num2 mul=num1*num2; #perform multiplication operation print("the product of given numbers is: ",mul) #display the product
When the above code is compiled and executed, it produces the following results
Enter the first number: 23 Enter the second number is: 32 the product of the given numbers is 736
This is a simple Python program to find the product of two integer numbers.
In the above program, we declared two different integer values such as 12 and 32 stored in variables num1, num2, respectively.
Then, we can find the product of given numbers using the * operator in Python
finally, we could display the result on the screen using the print() function in Python language.
multiply two floating point numbers
num1=float(input("Enter first number: ")) #input value for variable num1 num2=float(input("Enter second number: ")) #input value for variable num2 mul=num1*num2; #perform multiplication operation print("the product of given numbers is:",mul) #display the product
When the above code is compiled and executed, it produces the following results
Enter first number: 3.43 Enter second number:21.2 product of given numbers is: 72.716
This is a simple Python program to find the product of two floating point numbers.
In the above program, we declared two different floating point values such as 3.43 and 21.2 stored in variables num1, num2, respectively.
Then, we can find the product of given numbers using the * operator in Python
finally, we could display the result on the screen using the print() function in Python language.
Similar post
C++ program to multiply two numbers using function
Java program to multiply two numbers using method
Python program to multiply two numbers using function
C# program to multiply two numbers using function
PHP program to multiply two numbers using function
Find product of two numbers using method in Java
Find product of two numbers using recursion in Java
C program to multiply two numbers
C++ program to multiply two numbers
Java program to multiply two numbers
Python program to multiply two numbers
C# program to multiply two numbers
PHP program to multiply two numbers
JavaScript program to multiply two numbers
Calculate the total of array elements in Java
Calculate the total of array elements in C
Calculate the total of array elements in C++
Java program to calculate sum of array elements
C program to calculate sum of array elements
Java Program to calculate average of array
C Program to calculate average of array
Java Program to calculate average of odd and even numbers in an array
Java Program to calculate average of odd and even numbers
C Program to calculate average of odd and even numbers in an array
C Program to calculate average of odd and even numbers
C++ Program to calculate average of odd and even numbers in an array
C++ Program to calculate average of odd and even numbers
Suggested for you
Single dimensional array in C language
Data type and variable in C language
Single dimensional array in C++ language
Single dimension array in Java
2 Comments
Charlie December 4, 2019 at 6:26 pm
Hello, how do I multiply an integer by a number, because i am making a program in python where you type your age then it shows you your age in years, months and days. when i try and do the command months = age*12 and do print(“You are”, months,”in months”) it just outputs the age 12 times.
Charlie December 4, 2019 at 6:27 pm
BTW 12 is the number you multiply by to get the months
nikki December 22, 2021 at 4:09 am
how to accept 2 number of float data types and find their product