Suppose Operator Exist Python Define Function Notequal Takes Two Numbers Gives Result Oper Q37192337

Suppose the operator != does not exist in Python. Define afunction not_equal that takes any two numbers and gives the sameresult as the != operator. You cannot use != in your program. Testyour program using x = -12 and y = 3; x = 3 and y = -12; and x = y= -12.


Answer


def not_equal(x, y): return not (x == y)print(not_equal(-12, 3))print(not_equal(3, -12))print(not_equal(-12, -12))

True False Process finished with exit code O

color{blue}Please;let;me;know;if;you;have;any;doubts Please;upvote;this;answer.;;Thanks!!

True False Process finished with exit code O We were unable to transcribe this image

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.