Skip to content

Instantly share code, notes, and snippets.

@shihongzhi
Created January 2, 2011 04:58
Show Gist options
  • Save shihongzhi/762298 to your computer and use it in GitHub Desktop.
Save shihongzhi/762298 to your computer and use it in GitHub Desktop.
身份证最后一位认证
#输出最后一位校验码
print (12-reduce(lambda x,y:x+y,map(lambda x:int(x[0])*x[1],zip('330225198708292872'[0:17],[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2,1])))%11)%11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment