Brian Oney <brian.j.o...@googlemail.com> writes: > On Fri, 2018-07-20 at 06:37 +0000, Steven D'Aprano wrote: >> On Fri, 20 Jul 2018 08:25:04 +0200, Brian Oney via Python-list wrote: >> >> > PS: Can I twiddle bits in Python? >> >> Yes. >> >> These operators work on ints: >> >> bitwise AND: & >> bitwise OR: | >> bitwise XOR: ^ >> > That's right I had forgotten about that.
There's also ~ for bitwise negation. Rather than explain what this means in a language with an unbounded integer type, you might like to experiment, er, a bit. (Excuse the pun.) -- Ben. -- https://mail.python.org/mailman/listinfo/python-list