Use echo method instead of print
Use list comprehension when possible