-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoperator.py
36 lines (27 loc) · 1.08 KB
/
operator.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
x = 25;
y = 5;
io = 1;
#Arithmetic operator(math)
print(x+y); #x + y
print(x-y); #x - y
print(x*y); #x(y)
print(x/y); #x divided
print(x//y); #floor number to integer
print(x%y); #get division remainder
print(x**y); #power
#Comparison operator(true or false)
print(x<y); #x < y
print(x<=y); #x < or = y
print(x>y); #x > y
print(x>=y); #x > or = y
print(x==y); #x = y
print(x!=y); #x not = y
#Logical operators(use in if else)
if x == 25 and y == 5 :
print("and is x == 25 and y == 25 true of false");
elif x == 25 or y == 5 :
print("or x == 25 of y = 5 true of false");
#Sequence Operators(True false)
room = ["1/1","1/2","1/3"];
print("1/1" in room);
print("1/2" not in room);