+ 6
waht the << or >> in Python.
I still don't come to the lesson who teach this, so what it do? look at the code, this is returned 0 all the time. sorry if my English is not good.... https://code.sololearn.com/c0Q98Y55T8Bo/?ref=app
4 Respuestas
+ 7
These are bitwise operators. You can learn more about them here
https://www.sololearn.com/learn/4086/?ref=app
https://www.sololearn.com/learn/4087/?ref=app
+ 8
x<<n means duplicate x n times.
x>>n means n times floor division of x by 2.
Actually it is bitwise shifting but thats how to compute it.
+ 3
>> and << are bit shift operator (if operators are integer).
>> shift bits on right while << on left. Take 12 in base 2:
12= 1100
then:
12>>2 = 11(base 2)= 3
12<<2= 110000(base 2)= 48