Ad
  • Default User Avatar

    The smaller the scope, the shorter the name. For 2 lines any reasonable (like l for "length") 1-letter name is OK.
    l should be avoided in Python because PEP8 says

    Never use the characters 'l' (lowercase letter el), 'O' (uppercase letter oh), or 'I' (uppercase letter eye) as single character variable names.

    Although I'd just recommend using good fonts rather than forbidding letters.

  • Custom User Avatar

    I would go even further and avoid using one letter names for variables (maybe with a few exceptions). Here (CW) are few people who cares about readable code. I belive this is obvious enough to accept this.

  • Default User Avatar

    I know it's just a kind of pseudo code, but I would not name 'length of list' by letter l cause it mostly mean a list so n would be better :)

  • Default User Avatar

    Okay, sorry ! :)

  • Custom User Avatar

    Use spoiler flag next time, please. It's visible in the homepage if you don't.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution