-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path03_opreators.py
52 lines (44 loc) · 1.01 KB
/
03_opreators.py
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
print("-------Arithmetic Opreator-------")
a=6
b=9
print("The value of 6+9 is",6+9)
print("The value of 6-9 is",a-b)
print("The value of 6*9 is",a*b)
print("The value of 6/9 is",a/b)
print("-------Assignment Opreator--------")
A=10
B=20
C=30
D=40
A+=2
B-=2
C*=2
D/=2
print(A,B,C,D)
print("--------Comparision Opreator------")
print(A<B)
print(A<C)
print(A<D)
print(A<10)
print(A!=12)
print("Hello" != "python")
print("-----------Logical Opreator--------")
print("The vlaues are",A and B)
bool1=True
bool2=False
print("The value of bool1 and bool2 are :", bool1 and bool2)
print("The value of bool1 or bool2 are : ", bool1 or bool2)
print("The value of bool1 is:", bool1 )
print("The value of not bool1 :", (not bool1 ))
print("-----------Identity Opreator--------")
var1 = ["apple","banana"]
var2 = ["apple","banana"]
var3 = ["apple","banana"]
var1 = var3
print(var1 is var2)
print(var1 is var3)
print(var1 == var2)
print("-----------MmeberShip Opreator--------")
#in/not in
print(1 in [1,2,3])
print("a" not in "seffi")