python中 if not x 和if x<0有什么区别(x的值为整数)
实质是有区别的,想知道是什么原因
not 应该类似取反操作,not False -> True, 对于题中的x,除了0为假 -> not 0 即True,其它整数为真(not x)都是 False