News for hackers. Stuff that matters.
Re:Python built-ins worth learning (2019) by actually_a_dog on Wednesday March 09, 2022 @09:32PM (#30622581)
Wouldn't it be easier to say

    if numbers == []:
       print ("The numbers list is empty")
if your intent is to express "is the list empty?" in the condition?
Re:Python built-ins worth learning (2019) by sritchie on Wednesday March 09, 2022 @09:43PM (#30622641)
That condition would fail on non-list sequences, like `numbers == (1,2,3)`; the `len` version makes the code more permissive.