Write a program to accept two numbers from the user and calculate multiplication

Python Fundamentals of Python (Article) Fundamentals of Python (Program)

389

Given Input:

Enter first number 12
Enter second number 4

Expected Output:

Multiplication is 48

Hints:

  • Use Python 3’s built-in function input() to accept user input
  • Convert user input to the integer type using the int() constructor.

Program:

num1 = int(input("Enter first number "))
num2 = int(input("Enter second number "))

res = num1 * num2
print("Multiplication is", res)

Output:

Enter first number 12
Enter second number 4
Multiplication is 48

Explanation:


This Particular section is dedicated to Programs only. If you want learn more about Python. Then you can visit below links to get more depth on this subject.