Ad
  • Default User Avatar

    Agreed and we'd have to refactor the list creation to store the list as a variable first before we can call len() without duplicating the list for access.

    Which leads me to think, why is this considered "best practice"? I've rarely seen production code NOT store a list as a variable first before performing operations. Perhaps this helps to save memory for certain applications.

    Would love to have a discussion about the tradeoffs made in this solution.