How to Sum Subtraction Multiplication Division using Python || Floor Division
Sum Subtraction using Python
In mathematics, subtraction (also called difference) is the operation of subtracting two numbers, usually denoted by the minus sign (-). Multiplication (also called product) is the operation of multiplying two numbers, usually denoted by the multiplication sign (×). Division (also called remainder) is the operation of dividing two numbers, usually denoted by the division sign (÷).
Python provides various operators for performing these operations. The most common is the subtraction operator (-), which takes two numbers and subtracts the first number from the second. For example, the following code prints the value of 4 - 3
#Starting Coding
# this is my variable a and b
a=9
b=2
print(a+b) #Sum a & b
print(a-b) #Sub a & b
print(a*b) #mult a&b
print(a/b) #divi a&b
# Lets run it
# now change the variable value and again check
# its perfectly work, lets another one
print(a//b)
# This time print only integer value of division. Its called Floor Division.
# Run it again
# Lets another one
print(a**b)
# This time print the square value. that means a is base and b is the Power of a
# Lets run it again
# change the value for undterstanding easily.
# a=9 and b=2 that means our ans is 81. Lets chack
# Thanks for watching
#Ending Coding
Multiplication Division using Python
Multiplication division is a calculation that allows you to divide one number by another number. Multiplication division can be thought of as a way of reducing a large number down to a smaller, more manageable number. In Python, multiplication and division are performed using the operator "/".
To divide a number by 10, for example, you would use the following code: number_to_divide = 10 number_to_divide_by = number_to_divide / 10 . To divide a number by 100, you would use the following code: number_to_divide = 100 number_to_divide
Floor Division
In Python, floors are a built-in data type that represent division of integers. While there are other division libraries available, such as the NumPy library, Python's built-in division algorithm is efficient and reliable.
To divide two integers, you can use the floor function. For example, to divide 2 by 3, you would use the floor function to get the integer result that is less than or equal to 3:
2 // 3 = 0
2 // 3 = 4
Floor division is a common operation in Python, and you can use it to divide a number by python.