-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOperators.py
More file actions
38 lines (29 loc) · 782 Bytes
/
Operators.py
File metadata and controls
38 lines (29 loc) · 782 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
#assigning values are shown
x = 15
y = 4
print('x = ', x)
print('y = ', y)
#addition
print('the value for x + y = ', x+y)
#subtraction
print('the value for x - y = ', x-y)
#multiplication
print('the value for x * y = ', x*y)
#division
print('the value for x / y = ', x/y)
#division and truncate
print('the value for x // y = ', x//y)
#exponential
print('the value for x ** y = ', x**y)
#conditional operator
print('the value of x > y is ', x>y)
print('the value for x == y = ', x==y)
print('the value for x != y = ', x!=y)
print('the value for x >= y = ', x>=y)
#boolean values
a,b = True,False
print('the value of a = ',a)
print('the value of b = ',b)
print('the value of a and b = ', a and b)
print('the value of a or b = ', a or b)
print('the value of not a = ', not a)