0

What does' >> 'mean in python?

27th Jul 2016, 6:10 PM
ashish dubey
ashish dubey - avatar
7 Réponses
+ 5
If you wonder about it apearing on Terminal It's NOTHING... It's just the way Python console appears.. Where you can execute small python codes, line by line.. . It's like username-pc:$ for Linux Terminal root@user:# for Root terminal C:\ for windows command prompt ---- If it's used as an OPERATOR.. It's the right-shift operator of Bitwise. print(5>>2) Output : 1 --how?---- 5 = 101 (in binary) The statement will shift 101 right by 2 bits.. 1 0 1 _\-\-\ shifted right by one bit 0 1 0 _\-\-\ again 0 0 1
28th Jul 2016, 3:36 PM
Prashant Shahi
Prashant Shahi - avatar
+ 1
'nothing' is not true. To understand this you'll have to learn how a computer stores numbers. try: print( 8 >> 1) # Result will be 4 or: print( 8 << 1) # Result will be 16 In the first example the bits of number 8 (1000 in binary) will be shifted to the right by 1 position which results in 4 (100). The second example will shift the bits of 8 to the left by 1. The result is 16 (10000). So shifting to the right by 1 is similar to dividing by 2, and shifting to the left by 1 is same as multiplying by 2. Hope that helps
10th Aug 2016, 9:25 AM
Honk
+ 1
This is bitwise right shift operator which works with binary form of a number and in interpreter it also indicates that u can start program.
10th Aug 2016, 9:50 AM
Samiul Sk
Samiul Sk - avatar
0
You can say we are starting program from here. This is nothing but similar to $ or #symbol in Linux
2nd Aug 2016, 8:58 PM
Samiul Sk
Samiul Sk - avatar
0
It means u r in console mode or we can say interactive mode.in this mode it wil provide u output instantly for each code u type
12th Aug 2016, 6:50 PM
Gulshan Kumar
Gulshan Kumar - avatar
- 2
Nothing at all
31st Jul 2016, 6:20 AM
Calubos D.
Calubos D. - avatar
- 3
NOTHING!!!!!!!
10th Aug 2016, 9:28 AM
Calubos D.
Calubos D. - avatar