Python Program to find product of two integer numbers
Program
a = int(input('Enter number for a: '))
b = int(input('Enter number for b: '))
product = a * b
print('Product = ', format(product))
This Python program takes two numbers as input, calculates their product (multiplication), and prints the result.
a = int(input('Enter number for a: '))
b = int(input('Enter number for b: '))
input()
function takes user input as a string.int()
function converts the input to an integer.- The user enters two numbers (
a
andb
).
product = a * b
- Multiplication (
*
) is performed, and the result is stored inproduct
.
print('Product = ', format(product))
- Prints the product using
format(product)
.
Key Takeaways:
- User inputs two numbers.
- Conversion to integers using
int()
. - Multiplication (
*
) is performed. - Result is displayed using
format()
.
This program is a simple way to demonstrate basic arithmetic operations in Python!
Output
Enter number for a: 5
Enter number for b: 2
Product = 10