def check(): if [1,2,3]: return [2,3,4] check() [2, 3, 4]
I thought [1,2,3] is a list but not a Boolean expression that can be True or False? But why does the function consider the list ([1,2,3]) to be True?
[1,2,3]
([1,2,3])
Aucun commentaire:
Enregistrer un commentaire