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
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.
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
The data type in C++ language
Single dimension array in Java
Explanation of one dimensional array In this post, we will discuss the concept of "Explanation…
Python program to calculate the sum of odd and even numbers in a list In…
Python code to Calculate sum of odd and even in a list In this tutorial,…
How to find reverse number using method In this article, we will discuss the concept…
C# inverted full pyramid star pattern In this article, we will discuss the concept of…
C# Full Pyramid star pattern program In this article, we will discuss the concept of…
View Comments
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.
BTW 12 is the number you multiply by to get the months
how to accept 2 number of float data types and find their product