Skip to content

Commit d872782

Browse files
1920lesson
1 parent e7bb3a8 commit d872782

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

1920lesson.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Xor RightShift Leftshifi
2+
a = 5
3+
b = 2
4+
c = a^b
5+
# print('Xor value is ', c)
6+
# 5 => 101
7+
# 2 => 10
8+
# 101
9+
# 10
10+
# 00000111
11+
12+
# Right shift >> more younger
13+
x = 10
14+
y = x>>2
15+
# print('right shift ', y)
16+
17+
# x => 00001010
18+
# remove (right2place) and add two zero infront of
19+
# x => 00000010 (Answer)
20+
21+
# Left shift << more older
22+
p = 15
23+
t = p << 3
24+
25+
# print('Left shift value is ', t)
26+
27+
# p => 00001111
28+
# remove lefplace 01111 + 000
29+
# p => 01111000
30+
31+
32+
33+
34+

0 commit comments

Comments
 (0)