What is the most efficient way to toggle between 0 and 1?
0
1
I always use:
p^=True
If p is a boolean, this switches between true and false.