OR gate implement in python by R4R Team

-OR is a logical gate that give output True when any of the input is True.

Truth table of OR gate-

A B A OR B
False False False
False True True
True False True
True True True


program-

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

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


output-

A B A or B
False FalseFalse
False True True
True False True
True True True


-In this program, we create a function OR(x,y) which return True if any of the input is True.




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!