q = ((i + 2) * 6) >> 3
what's the meaning in python?
Pretty much the same as in any other language with C-like operators. Other than that I can only say that it smells of homework, and as such wouldn't be permitted in the main forums.
>> and << are bitwise shift operators.
So consider the binary representation of the number and shift it accordingly...
In your case the ">> 3" means shift three steps, kinda like here dropping the last three binary digits e.g.:
71 is 1000111 , shifting 3 bits gives 1000 = 8
72 is 1001000, shifting 3 bits gives 1001 = 9
# python
>>> print 71 >> 3
8
>>> print 72 >> 3
9
HTH
i don't understand your answer. I can't find this operator in a guide.
---------- Post updated at 06:01 AM ---------- Previous update was at 05:59 AM ----------
ok is a SHIFT operator!!