Use list comprehension to avoid extra lines of code.