Skip to content

Instantly share code, notes, and snippets.

@Marva82
Created June 8, 2018 16:29
Show Gist options
  • Save Marva82/7a629e86f0e14048907a2d4db6769999 to your computer and use it in GitHub Desktop.
Save Marva82/7a629e86f0e14048907a2d4db6769999 to your computer and use it in GitHub Desktop.
List Comprehension
#Creating a list using List Comprehension
squares = []
for i in range(1,11):
squares.append(i*i)
print(squares)
squares = [i*i for i in range(1,15)]
print(squares)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment