Find out the multiplication of two numbers in Python

Find out the multiplication of two numbers in Python :

In this tutorial, we will learn how to find out the multiplication of two numbers in python. The program will ask the user to enter the numbers and then it will calculate the multiplication of the numbers. Finally, it will print out the multiplication result.

Python program :

Below is the python program for the above problem :

python multiplication of two numbers

Explanation :

The commented numbers in the above program denote the step numbers below :

1. Ask the user to enter the first and second number. Read it and store it in first_number and second_number variables. Here, we are using input() method to take the user input. Also, we are converting the input to an integer using int() method.

If the user will enter anything else than an integer, e.g. a string, it will throw one ValueError

2. Next, find out the multiplication of these numbers. * is the multiplication operator in python.
3. Finally, print out the result to the user. Note how we are using the curly braces to print out the results.

Sample Output :

python find multiplication of two numbers

python find multiplication two numbers

Conclusion :

In this tutorial, we have learned how to find out the multiplication of two numbers in python. Try to run the above program on your machine and drop one comment below if you have any queries.

You might also like :

Leave a Reply