git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

a &= b


On Fri, 4 Oct 2019 at 19:02, Hongyi Zhao <hongyi.zhao at gmail.com> wrote:
>
> Could you please give me some more hints on:
>
> a &= b

$ python3
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> a = 15
>>> b = 3
>>> c = a & b
>>> d = a
>>> d &= b
>>> for i in [a, b, c, d]:
...     print('{:04b}'.format(i))
...
1111
0011
0011
0011
>>>