mardi 27 février 2018

Test Boolean Values in python with single output value

I have a list which has different Boolean values.

x = [True, True, True, True, False, False, True, False]

i want to check that if there is any value in the list is "False" then I want a final output value to be "True". If there is no "False" or all "True" value then the final output will be "False".

Something like this,

#x has False value 
#>>> a = True (a is a variable)
# x doesn't have False or all True
#>>> a = False

Please help!

Aucun commentaire:

Enregistrer un commentaire