Articles

Python program to find product of two numbers

Python program to find product of two numbers


In this python programs guide, we will learn to write:

  • python program to find product of two numbers

Program to find the product of two numbers in Python

Given below is python program to find product of two numbers:

# Owner : TutorialsInhand Author : Devjeet Roy

n1 = int(input("Enter first number: "))
n2 = int(input("Enter second number: "))

prod = n1 * n2

print("The product is:",prod)

The output of the program is as follows:

 

PS C:\Users\DEVJEET\Desktop\tutorialsInHand> python code.py
Enter first number: 23
Enter second number: 12
The product is: 276

Few important points about this program:

1. The product of the two numbers can be calculated using "*" operator in Python.

2. Even without using the "prod" variable, we can directly find the product inside the print function by specifying n1 * n2 in place of "prod".

 

product of two numbers in python

 


Basic Python Programs

Would you like to see your article here on tutorialsinhand. Join Write4Us program by tutorialsinhand.com

About the Author
Devjeet Roy
Full Stack Web Developer & Data Science Enthusiast
Page Views :    Published Date : Jan 23,2021  
Please Share this page

Related Articles

Like every other website we use cookies. By using our site you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Learn more Got it!