Fair enough but while I've used list comprehensions or similar constructs while doing stats, never seen it in game code.
Usually it's just incrementing things in a loop, rather than creating lists...
Like why wouldn't you just do:
for x in range(20):
if x % 2 == 0
print(x)
Or push it to a list or something. The specific type of list transformation that comprehensions make slightly easier isn't common in game code and doesn't make things more readable versus for loops.
Usually it's just incrementing things in a loop, rather than creating lists...
Like why wouldn't you just do:
for x in range(20):
Or push it to a list or something. The specific type of list transformation that comprehensions make slightly easier isn't common in game code and doesn't make things more readable versus for loops.