-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoperator.py
More file actions
43 lines (37 loc) · 807 Bytes
/
operator.py
File metadata and controls
43 lines (37 loc) · 807 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
# Arithmetic Operators
x = 10
y = 5
z = x + y # Addition
# z = x - y # Subtraction
# z = x * y # Multiplication
# z = x / y # Division
print(z)
#assignment operator
a = 5
b = 10
c = a + b
c += a
c -= b
print(c)
#comparison operator
a=5
b=10
print(a==b)
print(a!=b)
print(a>b)
print(a<b)
print(a>=b)
print(a<=b)
#logical operator
e = True or False
# Truth table of 'or'
print("True or False is ", True or False)
print("True or True is ", True or True)
print("False or True is ", False or True)
print("False or False is ", False or False)
# Truth table of 'and'
print("True and False is ", True and False)
print("True and True is ", True and True)
print("False and True is ", False and True)
print("False and False is ", False and False)
print(not(True))