-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoperators.py
47 lines (44 loc) · 1.48 KB
/
operators.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
# Arithmatic Operators (=,-,*,/,**,//,%)
print('"""""""""""""""Arithmatic operators""""""""""""""""""""""')
num1=9
print("num1 is : ",num1)
num2=2
print("num2 is : ",num2)
print(' Multiplication of num1 * num2 = ', num1+num2)
print(' Addition of num1 * num2 = ', num1*num2)
print(' Subtraction of num1 * num2 = ', num1-num2)
print(' Division of num1 * num2 = ', num1/num2)
print(' Moduls of num1 * num2 = ', num1%num2)
print(' Float division num1 * num2 = ', num1//num2)
print(' Square of num1 * num2 = ', num1**num2)
# Assignment Operators(=,+=,-=,/=)
print('""""""""""""""" Assignment Operators """"""""""""""""""""""')
a=3
print(a)
a+=3
a-=2
a/=2
a%=2
a**=2
a//=2# Float Division its mean that after decimal value will remove
print(a)
#Comparison Operators (==,<,>,!=)
print('""""""""""""""" Comparison Operators """"""""""""""""""""""')
a=7
b=5
print("print True if a is equal to b: ",a==b)
print("print True if a is not equal to b: ",a!=b)
print('print True a less form b: ',a<b)
print("print True a grater from b: ",a>b)
print("print True a grater then and equal to b: ",a>=b)
print("print True a less then and equal to b: ",a<=b)
print('""""""""""""""" Logical Operators """"""""""""""""""""""')
a=4
b=7
print(a==b and a<b)
print(a<b and b>a)
print(a==b or a<b)
print(not(a==b))
c=(a==b or a<b)
print("c Value is ",c)
print('after not c value is: ',not(c))