-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTask operators.py
79 lines (64 loc) · 1.21 KB
/
Task 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Python 3.11.2 (tags/v3.11.2:878ead1, Feb 7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> # 1. What is differneces between = , ==
... # (=) to define a variable value x = 2
... x = 2
... # (==) its mean is x equal 2 ?
... x== 2
... True
...
...
... # 2.What do we mean by using !=
... # its mean its not equals
... x != 2
... False
...
...
... # 3.What is operator precedence
... # its mean wish operators comes first
...
...
... # 4. Creat a variable x with value 10
... x = 10
...
...
... # 5.increase x Value by 15 using Assignment operators
... x= x + 5
... x
... 15
...
...
... # 6.Divide the x Value by 5 using assignment operators
... x /= 5
... x
... 3.0
...
...
... # 7.Multiply the x value by 10 using assignment operators
... >>> x *= 10
... >>> x
30.0
# 8.Get module of x on 3 using assignment operators
x %=3
x
0.0
# 9.Using Python print the module of 11 to 4
x = 11
x %=4
print (x)
3
# 10. Print the exponent of 2,3
x = 2
x **=3
x
8
# 11.Divide 11 by 3 using Python division
x = 11
x /=3
x
3.6666666666666665
# 12.can we divide 11 by 3 and get an integer numbers?
x = 11
x //=3
x
3