mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-04-10 15:55:53 +00:00
The program prompts the user to enter a binary number. It checks if the input contains only 0s and 1s using a generator expression. If the input is valid, it calls the count_zeros_and_ones function and prints the results. If not, it notifies the user of the invalid input.
Bit manipulation
Bit manipulation is the act of manipulating bits to detect errors (hamming code), encrypts and decrypts messages (more on that in the 'ciphers' folder) or just do anything at the lowest level of your computer.
- https://en.wikipedia.org/wiki/Bit_manipulation
- https://docs.python.org/3/reference/expressions.html#binary-bitwise-operations
- https://docs.python.org/3/reference/expressions.html#unary-arithmetic-and-bitwise-operations
- https://docs.python.org/3/library/stdtypes.html#bitwise-operations-on-integer-types
- https://wiki.python.org/moin/BitManipulation
- https://wiki.python.org/moin/BitwiseOperators
- https://www.tutorialspoint.com/python3/bitwise_operators_example.htm