Skip to content

Instantly share code, notes, and snippets.

@Wingless-Archangel
Created November 6, 2016 06:12
Show Gist options
  • Save Wingless-Archangel/fe05e9f2f5e5967eebbbb0aac162da98 to your computer and use it in GitHub Desktop.
Save Wingless-Archangel/fe05e9f2f5e5967eebbbb0aac162da98 to your computer and use it in GitHub Desktop.
one liner python with list
#!/usr/bin/python3
def main():
a = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
b = [i for i in a if i % 2 == 0]
print(b)
if __name__=='__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment