Issue
I would like to write a statement in python with logical implication. Something like:
if x => y:
do_sth()
Of course, I know I could use:
if (x and y) or not x:
do_sth()
But is there a logical operator for this in python?
Solution
p => q
is the same as not(p) or q
, so you could try that!
Answered By - Juan Pablo Rinaldi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.