“If not” condition statement in python [duplicate]
问题 This question already has answers here : Why is “if not someobj:” better than “if someobj == None:” in Python? (9 answers) Closed 5 years ago . if not start: new.next = None return new what does "if not" mean? when will this code execute? is it the same thing as saying if start == None: then do something? 回答1: if is the statement. not start is the expression, with not being a boolean operator. not returns True if the operand ( start here) is considered false . Python considers all objects to