implement XNOR gate in python by R4R Team

-XNOR is a logical gate that give output True when all the input is same otherwise give False.

Truth table of XNOR gate-

A B A XNOR B
False False True
False True False
True False False
True True True


program-

def XNOR(x,y):
if x==y:
return True
else:
return False

print("AtBtA XNOR B")
print("False Falset",XNOR(0,0))
print("False Truet",XNOR(0,1))
print("True Falset",XNOR(1,0))
print("True Truet",XNOR(1,1))


output-

A B A XNOR B
False FalseTrue
False True False
True False False
True True True


-In this program, we create a function that are able to find the XNOR of the function as shown in above output.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!