Skip to content

Instantly share code, notes, and snippets.

@haqpl
Created July 1, 2018 09:31
Show Gist options
  • Save haqpl/c5c9ad9c1d5809e44cdca12b36bd698a to your computer and use it in GitHub Desktop.
Save haqpl/c5c9ad9c1d5809e44cdca12b36bd698a to your computer and use it in GitHub Desktop.
list comprehension solution
a = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
b = [c for c in a[:7]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment