Say I need to print all the elements of a list into the console on new lines.
for i in lst:
print(i)
Is it okay to do this instead?
[print(x) for x in lst]
I know I'm not saving the resulting list this way, but it allows me to shorthand the above example onto one line. Will this create unneccessary grabage in the memory or should this be avoided for some different reason?