Skip to content

Instantly share code, notes, and snippets.

@timothycrosley
Created April 29, 2016 22:11
Show Gist options
  • Save timothycrosley/fbfbf16b8609b06eff183ec2782cbe5c to your computer and use it in GitHub Desktop.
Save timothycrosley/fbfbf16b8609b06eff183ec2782cbe5c to your computer and use it in GitHub Desktop.
my_favorite_numbers = []
for number in range(10):
if number == 7 or number == 42:
my_favorite_numbers.append(number)
my_favorite_numbers = [number for number in range(10) if number == 7 or number == 42]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment