implement NOT gate in python by R4R Team

-NOT is a logical gate that give output True if input is False, and give False if input is True.

Truth table of NOT gate-

A NOT A
False True
True False


program-

def NOT(x):
if x==1:
return False
else:
return True

print("AtNOT A")
print("Truet",NOT(1))
print("Falset",NOT(0))


output-

A NOT A
True False
FalseTrue


-In this program, we create a function NOT(x) which find the not of the 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!