Difference between Bitwise, Bitwise exclusive, and Boolean "AND" + "OR" statements. | Sololearn: Learn to code for FREE!


Difference between Bitwise, Bitwise exclusive, and Boolean "AND" + "OR" statements.

What's the difference between the Bitwise '&' and the Boolean 'and' expressions. They don't seem to do much else. Also, does the '~' mean.

11/13/2019 6:45:19 PM


6 Answers

New Answer


Go through the link properly Bitwise operators are applicable to integer types only https://www.sololearn.com/learn/4070/?ref=app As for Boolean you are right but go through your python course again https://www.sololearn.com/learn/Python/2279/


https://code.sololearn.com/cMpDcIY1S7lY/?ref=app Bitwise operation works on an integer, it converts it to binary and executes the action bit by bit See this example for bitwise xor https://code.sololearn.com/cRXYx1v8t7IQ/?ref=app Edit: This code by Burey summarises bitwise operations perfectly. https://code.sololearn.com/WBOdrCZZT0a7/?ref=app Thanks ~ swim ~ for the link lower down that lead to this.


Thank you both Louis and ~ swim ~ for the help! All questions are answered!


What is your current understanding?


I know what the operators mean but I don't know the difference, as I see it right now. To my knowledge the "and" and "or" is for Boolean. Bitwise I would assume goes with floats and integers.


Louis πŸ‘β˜ΊπŸ™