>> operator in Python

后端 未结 5 1638
无人及你
无人及你 2020-11-30 08:48

What does the >> operator do? For example, what does the following operation 10 >> 1 = 5 do?

5条回答
  •  日久生厌
    2020-11-30 08:58

    See section 5.7 Shifting Operations in the Python Reference Manual.

    They shift the first argument to the left or right by the number of bits given by the second argument.

提交回复
热议问题