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

+1

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

Riggonatio

6 Answers

New Answer

+2

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/

+3

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.

+2

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

+1

What is your current understanding?

+1

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.

+1

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