Skip to main content

Posts

Showing posts from December, 2024

6 Python Examples using bit manipulation for beginners

Numbers are represented using bits internally in computers, each bit can contain a boolean value 0 or 1 i.e., whether the bit is set or not. Bit manipulation is a concept where the individual bits within a given number are modified and/or looked at. There are quite a few cases where bit manipulation provides effective coding while consuming less memory. While bit manipulation is very popular in languages like C/C++, the article highlights some usage of bit manipulation using beginner-friendly examples.