Skip to content

Instantly share code, notes, and snippets.

@xr09
Created January 28, 2014 21:40
Show Gist options
  • Select an option

  • Save xr09/8677086 to your computer and use it in GitHub Desktop.

Select an option

Save xr09/8677086 to your computer and use it in GitHub Desktop.
bitwise
>>> map(lambda n: 1 << n, xrange(10))
[1, 2, 4, 8, 16, 32, 64, 128, 256, 512]
>>> from math import pow
>>> map(lambda n: pow(n, 2), xrange(10))
[0.0, 1.0, 4.0, 9.0, 16.0, 25.0, 36.0, 49.0, 64.0, 81.0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment