-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path12.Operators.py
More file actions
73 lines (43 loc) · 803 Bytes
/
12.Operators.py
File metadata and controls
73 lines (43 loc) · 803 Bytes
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Operators
# Arithmetic Operators
print (5**3)
# ** works as power assigning operator
print (720//70)
# Gives only the integer value after division
print (40%7)
# Gives the remender
print()
"""
Common operators
+ : Addition
- : Substraction
* : Multiplication
/ : Division
"""
# Assignment Operator
a = 20
a += 5
print(a)
# += adds the L.H.S value
print()
"""
Similarly, we have
-= : Substraction
*= : Multiplication
/= : Division
# = is also a assignment operator
"""
# Comparison Operators
print (a == 25)
# Compares the equality R.H.S. and L.H.S. value
print (a != 25)
# Compares the non - equality of R.H.S. and L.H.S.
"""
Similarly, we have
>=
<=
"""
# Logical Operators - and, or
# | = or
# Identical Operators - is, not, is not
# Membership Operators - in, not in