Python program to multiply two number using function
- Home
- Calculations
- Python program to multiply two number using function
- On
- By
- 0 Comment
- Categories: Calculations, multiply
Python program to multiply two number using function
Python program to multiply two number using the function
In this tutorial, we will discuss the Python program to multiply two number using the function
In this topic, we will learn a simple concept of how to multiply two numbers using the function in the Python programming language
already we will know the same concept using the operator in Python
if you know click here Python program to multiply two numbers
Python program to multiply integer number
Program 1
#Python program to multiply two numbers using function def mul_Num(a,b):#function for find product multiply=a*b; return multiply; #return value num1=25 #variable declaration num2=55 print("The product is",mul_Num(num1,num2))#call te function
When the above code is compiled and executed, it produces the following results
The product is 1375
program to multiply integer number– get input from the user
#Python program to multiply two numbers using function def add_num(a,b):#function for multiplication multiply=a*b; return multiply; #return value num1=int(input("input the number one: "))#input from user for num1 num2=int(input("input the number one: "))#input from user for num2 print("The product is",add_num(num1,num2))#call te function
When the above code is compiled and executed, it produces the following results
input the number one: 24 input the number one: 12 The sum is 288
program to multiply floating point number
Program 1
#Python program to multiply two numbers using function def mul_Num(a,b):#function for multiplication multiply=a*b; return multiply; #return value num1=2.456 #variable declaration num2=55.54 print("The product is",mul_Num(num1,num2))#call the function
When the above code is compiled and executed, it produces the following results
The product is 136.40624
program to multiply floating point number – get input from the user
#Python program to multiple two numbers using function def mul_Num(a,b):#function for multiplication multiply=a*b; return multiply; #return value num1=float(input("input the number one: "))#input from user for num1 num2=float(input("input the number one: "))#input from user for num2 print("The sum is",mul_Num(num1,num2))#call te function
When the above code is compiled and executed, it produces the following results
input the number one: 34.56 input the number one: 2.34 The sum is 80.8704
Suggested for you