0% found this document useful (0 votes)
6 views3 pages

Pythonp 1

Just PDF include a nice code of python it is a practice for practicals of python for very beginners it's about arithmetic operators and logical operators in few more operators included in that.

Uploaded by

zafarshaikhn336
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Pythonp 1

Just PDF include a nice code of python it is a practice for practicals of python for very beginners it's about arithmetic operators and logical operators in few more operators included in that.

Uploaded by

zafarshaikhn336
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

8/23/25, 4:00 PM pythonp1

In [8]:

1 #ARITHMATIC OPERATERS
2 ​
3 a=18
4 b=4
5 print("Sum=",a+b)
6 print("Sub=",a-b)
7 print("Mult=",a*b)
8 print("Div=",a/b)
9 print("Modulo=",a%b)
10 print("Expo=",a**b)
11 print("Int Div=",a//b)

Sum= 22
Sub= 14
Mult= 72
Div= 4.5
Modulo= 2
Expo= 104976
Int Div= 4

In [10]:

1 #RELATIONAL OPERATERA
2 ​
3 a=35
4 b=12
5 ​
6 print(a>b)
7 print(a>=b)
8 print(a<b)
9 print(a<=b)
10 print(a==b)
11 print(a!=b)

True
True
False
False
False
True

localhost:8888/notebooks/pythonp1.ipynb 1/3
8/23/25, 4:00 PM pythonp1

In [15]:

1 #LOGICAL OPERATER
2 ​
3 a=45
4 b=0
5 ​
6 print(a and b)
7 print(a or b)
8 print(not a)
9 print(not b)

0
45
False
True

In [23]:

1 #BITWISE OPERATER
2 ​
3 a=6
4 b=3
5 ​
6 print(~a)
7 print(a & b)
8 print(a ^ b)
9 print(a<<2)
10 print(b<<2)
11 print(a>>2)
12 print(b>>2)

-7
2
5
24
12
1
0

localhost:8888/notebooks/pythonp1.ipynb 2/3
8/23/25, 4:00 PM pythonp1

In [27]:

1 #BOOLEAN OPERATER
2
3 a=False
4 b=True
5
6 print(a & b)
7 print(a ^ b)
8 print(not a)
9 print(not b)

False
True
True
False

In [29]:

1 # ASSIGNMENT OPERATER
2 ​
3 a=6
4 b=2
5 ​
6 print(a+b)
7 a+=b
8 print(a)
9 a-=b
10 print(a)
11 a*=b
12 print(a)
13 a/=b
14 print(a)
15 a%=b
16 print(a)
17 a**=b
18 print(a)
19 a//=b
20 print(a)

8
8
6
12
6.0
0.0
0.0
0.0

localhost:8888/notebooks/pythonp1.ipynb 3/3

You might also like