Python Bitwise Operators Example - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
Python Bitwise Operators Example

Python Bitwise Operators Example


The bitwise operators perform bit by bit operation on the values of the two operands.

Operator
Description
& (binary and)
If both the bits at the same place in two operands are 1, then 1 is copied to the result. Otherwise, 0 is copied.
| (binary or)
The resulting bit will be 0 if both the bits are zero otherwise the resulting bit will be 1.
^ (binary xor)
The resulting bit will be 1 if both the bits are different otherwise the resulting bit will be 0.
~ (negation)
It calculates the negation of each bit of the operand, i.e., if the bit is 0, the resulting bit will be 1 and vice versa.
<< (left shift)
The left operand value is moved left by the number of bits present in the right operand.
>> (right shift)
The left operand is moved right by the number of bits present in the right operand.


About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.