How do I get the opposite (negation) of a Boolean in Python?

后端 未结 7 1462
太阳男子
太阳男子 2020-12-08 03:57

For the following sample:

def fuctionName(int, bool):
    if int in range(...):
        if bool == True:
            return False
        else:
            r         


        
相关标签:
7条回答
  • 2020-12-08 04:17

    You can just compare the boolean array. For example

    X = [True, False, True]
    

    then

    Y = X == False
    

    would give you

    Y = [False, True, False]
    
    0 讨论(0)
提交回复
热议问题