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

Python function

Operator Python

 

Cpp program to add two numbers using function
Java code to calculate electricity bill
Karmehavannan

I am Mr S.Karmehavannan. Founder and CEO of this website. This website specially designed for the programming learners and very especially programming beginners, this website will gradually lead the learners to develop their programming skill.

Recent Posts

C# inverted full pyramid star pattern

C# inverted full pyramid star pattern In this article, we will discuss the concept of…

3 weeks ago

C# Full Pyramid star pattern program

C# Full Pyramid star pattern program In this article, we will discuss the concept of…

1 month ago

Program to count vowels,consonants,words, characters and space in Java

Program to count vowels, consonants, words, characters and space in Java In this article, we…

1 month ago

How to print multiplication table using Array in C++ language

How to print multiplication table using Array in C++ language In this post, we will…

1 month ago

C Program to multiplication table using Array

C Program to multiplication table using Array In this tutorial , we will discuss about…

2 months ago

Java program to check odd or even using recursion

Java program to check odd or even using recursion In this tutorial, we discuss a…

2 months ago