all() function not returning expected value in Python

后端 未结 0 1943
日久生厌
日久生厌 2021-01-30 17:46

In Python,

a=[not(0)+1] print(all(a))

This returns False. But shouldn\'t it be True? Since, a=[2], and all integer values other than 0 are considered True. Thus, a

相关标签:
回答
  • 消灭零回复
提交回复
热议问题