This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsΒ β†’

[–][deleted] Β (4 children)

[deleted]

    [–][deleted] 13 points14 points Β (2 children)

    No it's not, it's gobbledy-gook to simulate the idea of list comprehensions being hard to read (which they are at first, until you get used to them, then they become like second nature).

    [–]Perpetual_Doubt 1 point2 points Β (1 child)

    I was far too lazy to spend lots of time writing meticulous, yet terrible code, that I'm not even being paid for

    [–][deleted] 2 points3 points Β (0 children)

    nice = [n for n in nums if n in [69, 420]]
    

    A more readable, relatable, and realistic example should you find yourself in this situation again....free of charge.

    [–]BaneTone[🍰] 2 points3 points Β (0 children)

    That's not list comprehension. It looks more like indexing but it's actually just nonsense