-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArithmetic Operator.py
More file actions
37 lines (37 loc) · 1.13 KB
/
Arithmetic Operator.py
File metadata and controls
37 lines (37 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#----------------------------------------
# Arithmetic Operator
#----------------------------------------
#They are used to perform mathematical operations like addition, subtraction, multiplication, division, etc.
# Addition
a = 10
b = 20
c = a + b
print(c) #This will print 30
#-------------------------------------------------------
# Subtraction
d = a - b
print(d) #This will print -10
#-------------------------------------------------------
# Multiplication
e = a * b
print(e) #This will print 200
#-------------------------------------------------------
# Division
f = b / a
print(f) #This will print 2.0
#-------------------------------------------------------
# Modulus
g = b % a
print(g) #This will print 0
#-------------------------------------------------------
# Exponentiation
h = a ** b
print(h) #This will print 100000000000000000000
#-------------------------------------------------------
# Division without the remainder
i = b // a
print(i) #This will print 2
#-------------------------------------------------------
#----------------------------------------
# Extra Content
#----------------------------------------