python how to "negate" value : if true return false, if false return true
How to "negate" value: if true return false, if false return true? Question: if myval == 0: nyval=1 if myval == 1: nyval=0 Is there a better way to do a toggle in python, like a nyvalue = not myval ? Asked By: user2239318 || Source Answers: Use the not boolean operator: nyval = not …
Total answers: 5