Differences between revisions 2 and 3
Revision 2 as of 2009-02-19 03:04:58
Size: 679
Editor: jigloo
Comment:
Revision 3 as of 2009-10-27 02:33:36
Size: 539
Editor: limodou
Comment:
Deletions are marked like this. Additions are marked like this.
Line 19: Line 19:
||<style="vertical-align: top;">[[PageComment2]]||<style="vertical-align: top;">[:MiscItems/2009-02-17/PageCommentData:PageCommentData] ||

TableOfContents

Include(ZPyUGnav)

一句话将int转化为二进制字符串

>>> bin = lambda n:'0b'+.join({'0':'0','1':'1','2':'10','3':'11','4':'100','5':'101','6':'110','7':'111','8':'1000','9':'1001','a':'1010','b':'1011','c':'1100','d':'1101','e':'1110','f':'1111'}[x] for x in hex(n)[2:].rstrip('L'))

>>> bin(65535)

"11111111111111111'


  • 反馈

MiscItems/2009-02-17 (last edited 2009-12-25 07:12:33 by localhost)