Example:1
division = 5 / 2
print(division)
OUTPUT
2.5
Example:2
num1=200
num2=20
div=num1/num2;
print("The division of {0} and {1} is: {2}".format(num1,num2,div))
Output
The division of 200 and 20 is: 10
Example: 3
num1=input("Enter the 1st number: ")
num2=input("Enter the 2nd number: ")
div=num1/num2;
print("The division of {0} and {1} is: {2}".format(num1,num2,div))
Output
Enter the 1st number: 100
Enter the 2nd number: 10
The division of 100 and 10 is: 10
Example: 4
#python program to divide two numbers
def divNum(a,b):
divide=a/b
return divide
num1=int(input("input the 1st number : "))
num2=int(input("input the 2nd number : "))
print("The division is: ",divNum(num1,num2))
Output
input the 1st number : 200
input the 2nd number : 10
The division is: 20
Example: 6
# for integers without flot value
print (10//2)
print (-10//2)
Output
5
-5
Example: 7
# "/" for floating point numbers
print (9.0/2)
print (-9.0/2)
Output
4.5
-4.5
Keywords:
python divide two numbers,
how to divide two inputs in python,
how to divide two variables in python,
python program to divide two numbers using function,
how to divide a variable by a number in python,
float division in python,
python divide two integers get float,
how to divide in python code,
python divide remainder,
how to divide two inputs in python {python divide two numbers} python code