在python中遇到需要对布尔值进行取反,做个笔记:

b = True
b = bool(1-b)  # 取反