Just to check, I couldn’t find anything about ~, so I want to make sure it’s the same.
Also, can you use ! in python like in C++?
It seems that these two codes give the same output:
bool(~0)
bool(not 0)
>Solution :
This is how it is in Python.
‘~’ is a bitwise operator
whereas ‘not’ is a logical opeartor