No video

Bitwise Right Shift Operator in Python

  Рет қаралды 26,822

Neso Academy

Neso Academy

Күн бұрын

Пікірлер: 22
@sinhalaigenumawithashokabandar
@sinhalaigenumawithashokabandar Ай бұрын
nice to heard this types of history data of our country. Thanks
@rajeshprajapati1851
@rajeshprajapati1851 Жыл бұрын
He has already done a great work in C language and now this.
@li0770
@li0770 Жыл бұрын
Thanks a lot. I hope you could explain about passing function as arguments of another function without including the parentheses, it's a tough topic for me
@intelinside1473
@intelinside1473 6 ай бұрын
>>> a=-12 >>> bin(a) '-0b1100' But in video 8:36 10100 = -12? Can anyone explain that pleace?
@big-jo89
@big-jo89 5 ай бұрын
because when you use the bin() function in Python to represent a negative integer, it returns the binary representation of the positive magnitude of that number, but with a leading '-' sign to indicate that it's a negative number of the same positive number. for example number 12 if we run >>> bin ( 12 ) it return '0b1100' == the binary representation of the positive 12 but when we run >>> bin ( - 12 ) it return '-0b1100' == the negative representation of the positive 12 but not in the actual binary representation of ( -12 ) which is '0b 1111 0100' I guess python choose to represents negative integers using two's complement notation is to maintain consistency and simplicity in its representation of integers, as this approach aligns with how integers are typically represented and manipulated in computer systems.
@satishgokul7176
@satishgokul7176 11 ай бұрын
@9:06 didn't understood how the shift occurs it should be 01010 instead 11010. please anyone correct me if i was wrong
@pmalik1975
@pmalik1975 10 ай бұрын
Yes I also feel the same
@big-jo89
@big-jo89 7 ай бұрын
because the leftmost bit indicates the sign (0 for positive, 1 for negative) in a 2's complement system. so you shift the actual bits not the bit which represent the number's sign. in this case, 1 is the most left bit which means that the number is negative. so for systems and compilers to differentiate between positive and negative number they put 0 or 1 in front of the binary to indicate its sign for the hardware can then work with them
@vonSmash
@vonSmash 5 ай бұрын
⁠@@big-jo89​​⁠​⁠​⁠​⁠yeah that’s true. My confusion though is that I thought that after the 2nd shift the binary would be 10101 not 11101. Because if we remove the sign number for a second, after the first shift we had 1010, right? Then if we shift it a second time it should be 0101, no? Or what am I missing? 😅
@big-jo89
@big-jo89 5 ай бұрын
@@vonSmash sorry but I didn't get what you mean
@vonSmash
@vonSmash 5 ай бұрын
​@@big-jo89 Yeah, I see that my question was a big badly formulated.. 😄 haha! let me try again. At 04:00 we first see him explaining the shift of the positive number 12 which is equal to 01100. If we just remove the sign number 0 here to make it a bit clearer then we have 1100, right? He then shows the first shift which goes from 1100 to 0110, and this makes sense to me because it looks like the 0 that was all the way to the right has now moved to the start on the left. Then the second moves is like I expected too, from 0110 to 0011. However, my confusion starts at 09:03 when he shows the negative numer, -12 = 10100 (remove the sign and we have 0100). Because when he show the first shift it goes from 0100 to 1010. Where did that extra 1 come from? And the same in the second shift, from 1010 to 1101. There is now three 1's. It feels like I've missed an explanation from him in the video but even after rewatching I can't understand it. Does my confusion make sense, and can you see what I'm getting wrong? Maybe my assumption is wrong form the start but don't know what I should assume otherwise 😅
@TribhuvanMahath
@TribhuvanMahath 10 ай бұрын
Thanks
@Ranganadhamkrishnachaitanya27
@Ranganadhamkrishnachaitanya27 Жыл бұрын
Nice explanation bro could please do SQL entire topic please brother
@user-iq8ll9op2y
@user-iq8ll9op2y 2 ай бұрын
it is working odd num or not?
@markuche1337
@markuche1337 Жыл бұрын
Awesome explanation thanks ❤
@harshitha8394
@harshitha8394 Ай бұрын
how we got a>>1 as 11010, where a = -12
@akramshaik5019
@akramshaik5019 24 күн бұрын
When do the right shift to the positive number for example : a=12 it's binary equivalent number is 01100 if a>>1 is used it becomes 00110 like u can see after shifting to the left side from the tens place we are getting 0's as it is a positive number and similarly we get 1 for the negative numbers as its binary representation is 1 so for a=-12 binary: 10100,a>>1 we get 11010....this is what I understood hope u find it helpful
@Med2402
@Med2402 Ай бұрын
from the negative number part it's not very clear
@majjiharish4165
@majjiharish4165 Жыл бұрын
upload in module and error concept
@rajisam4802
@rajisam4802 7 ай бұрын
if the division results in float values what should be the result??
Bitwise Left Shift Operator in Python
6:52
Neso Academy
Рет қаралды 18 М.
#14 Python Tutorial for Beginners | Python BitWise Operators
12:42
OMG what happened??😳 filaretiki family✨ #social
01:00
Filaretiki
Рет қаралды 13 МЛН
At the end of the video, deadpool did this #harleyquinn #deadpool3 #wolverin #shorts
00:15
Anastasyia Prichinina. Actress. Cosplayer.
Рет қаралды 2,8 МЛН
Just Give me my Money!
00:18
GL Show Russian
Рет қаралды 685 М.
🩷🩵VS👿
00:38
ISSEI / いっせい
Рет қаралды 28 МЛН
Bitwise Operators and WHY we use them
8:41
Alex Hyett
Рет қаралды 73 М.
I run untested, viewer-submitted code on my 500-LED christmas tree.
45:17
Bitwise Operators in Python (Part 1)
9:21
Neso Academy
Рет қаралды 35 М.
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 299 М.
C bitwise operators 🔣
6:47
Bro Code
Рет қаралды 73 М.
Operators in Python | Bitwise Operators | Python Tutorials for Beginners #lec17
17:11
Fastest Way to Learn ANY Programming Language: 80-20 rule
8:24
Sahil & Sarra
Рет қаралды 832 М.
OMG what happened??😳 filaretiki family✨ #social
01:00
Filaretiki
Рет қаралды 13 МЛН