implement NOR gate in python by R4R Team

-NOR is a logical gate that give output False if any of the input is True.

Truth table of NOR gate-

A B A NOR B
False False True
False True False
True False False
True True False


program-

def NOR(x,y):
if x==1 or y==1:
return False
else:
return True

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


output-

A B A NOR B
False FalseTrue
False True False
True False False
True True False


-In this program, we create a function that are able to return the NOR value of the given input.




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!