You need to use bool()
if you want to compare it directly
>>> weapon = []
>>> bool(weapon) == True
False
>>> weapon.append("sword")
>>> bool(weapon) == True
True
When you test a condition using if
or while
, the conversion to bool
is done implicitly
>>> if weapon == True: # weapon isn't equal to True
... print "True"
...
>>> if weapon:
... print "True"
...
True