Skip to content

Instantly share code, notes, and snippets.

@shihongzhi
Created January 18, 2011 11:38
Show Gist options
  • Save shihongzhi/784314 to your computer and use it in GitHub Desktop.
Save shihongzhi/784314 to your computer and use it in GitHub Desktop.
求0-13里的1的个数
reduce(lambda x,y:x+y,map(lambda x:str(x).count('1'), [t for t in range(13+1)]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment