-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTypes of operator.py
More file actions
52 lines (48 loc) · 894 Bytes
/
Copy pathTypes of operator.py
File metadata and controls
52 lines (48 loc) · 894 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
#Types of operator
''' Arithmetic operators { +,-,*,/,%,**}
Relational / Comparison Operator { ==, != , >,<, >=, <=}
Assignment Operators { =, +=, -=, *=, /=, %= , **=}
Logical Operators {not, and, or}'''
#Arithmetic operators
'''a = 3
b = 4
sum = a+b
diff = a-b
pro = a*b
div = a/b
mod = b%a
pow = a**b
print(sum)
print(diff)
print(pro)
print(div) #div always show answer as a floating value.
print(pow) # a^b
print(mod) #mod gives remainder'''
#Relational / Comparison operators
'''a = 50
b = 60
print(a != b)
print(a == b)
print(a >= b)
print(a <= b)'''
#Assignment operator
'''num = int(input("num : "))
num += 10
print(num)
num -= 10
print(num)
num *= 10
print(num)
num /= 10
print(num)
num **= 10
print(num)'''
#logical operator
a = 50
b = 60
val1 = True
val2 = False
print(not(a > b))
print(" answer :", val1 and val2)
print( a == b and a >= b)
print( a == b or a >= b)