Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

arithmetic operators in python

# Examples of Arithmetic Operator
a = 9
b = 4
 
# Addition of numbers
add = a + b
 
# Subtraction of numbers
sub = a - b
 
# Multiplication of number
mul = a * b
 
# Division(float) of number
div1 = a / b
 
# Division(floor) of number
div2 = a // b
 
# Modulo of both number
mod = a % b
 
# Power
p = a ** b
 
# print results
print(add)
print(sub)
print(mul)
print(div1)
print(div2)
print(mod)
print(p)
 
PREVIOUS NEXT
Tagged: #arithmetic #operators #python
ADD COMMENT
Topic
Name
6+1 =