Skip to content

Instantly share code, notes, and snippets.

@SecurityForUs
Created September 28, 2012 18:24
Show Gist options
  • Save SecurityForUs/3801393 to your computer and use it in GitHub Desktop.
Save SecurityForUs/3801393 to your computer and use it in GitHub Desktop.
:P
>>> num = "100"
>>> print sum([int(x)*(2**int(z)) for z,x in enumerate(num[::-1])])
4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment