You are looking for the function bool
.
>>> bool([])
False
>>> bool(['monty'])
True
What the Python Docs say.
Convert a value to a Boolean, using the standard truth testing procedure. If x is false or omitted, this returns False; otherwise it returns True. bool is also a class, which is a subclass of int. Class bool cannot be subclassed further. Its only instances are False and True.