-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPython_Operators.py
More file actions
37 lines (32 loc) · 876 Bytes
/
Python_Operators.py
File metadata and controls
37 lines (32 loc) · 876 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
# Operator in python
# 1 -> Arithmetic Operator
a, b = 10, 20
print("The value of a+b is : ", a + b)
print("The value of a-b is : ", a - b)
print("The value of a*b is : ", a * b)
print("The value of a/b is : ", a / b)
print("The value of a%b is : ", a % b)
# 2 -> Comparison Operator
print("\n\n Comparison Operator \n\n")
print("The value of a>b is : ", a > b)
print("The value of a<b is : ", a < b)
print("The value of a>=b is : ", a >= b)
print("The value of a=b is : ", a == b)
print("The value of a<=b is : ", a <= b)
print("The value of a!=b is : ", a != b)
# 3-> Assignment Operator(=,+=,-=,*=,/=)
x = 10
print("The value of x is : ",x)
x += 10
print("The value of x is : ",x)
x -= 10
print("The value of x is : ",x)
x *= 10
print("The value of x is : ",x)
x /= 10
print("The value of x is : ",x)
# Logical Operator
a = True
b = False
print(a and b)
print(a or b)