4/17/2018 6:28:21 PM
sweta t2 Answers
New AnswerThe & operator is equivalent to the intersection() operation, and creates a new set with elements common to a and b a = set([1, 2, 3]) b = set([3, 4, 5]) print(a & b) #->3 && is used to compare two values a=True && False a is false e.t.c
Just to add to Brain's excellent answer... I made this for demonstration for you (although it's a work in progress) https://code.sololearn.com/W26dgSxWvWCQ/#htm It demonstrates a binary AND operation, in an interactive way. This will also be how python acts with this operation. I also created this demonstration in python: https://code.sololearn.com/cGJ7gRt0ix2J/#py Any questions, please let me know. I will do my best to answer further. Good luck :-)
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message