Does negation operator exist in Python?
For example, in C++, a token or literal can be negated using '!' before it, like so:
5/1/2020 12:08:06 PM
No, I'm talking about the logical negation. Not the arithmetic negation. Take another look at my sample code.
Yes instead of ! not is used
X= not 1
This will result in 0
Yes why not you may directly use negative symbol for that purpose.
Now X will be equal to -1
Megha Suresh you should set the better answer mark on the answer wich has been the most helpful/informative... not to yours or one not relevant ^^
Thank you very much. 😊
Send us a message