CrLf 当前离线
论坛巡查
TOP
str='asdfsD1df' def l2u(str): ret='' for c in str: ret += chr(ord(c)&(0xff^0x20)) if c.isalpha() else c; return ret def u2l(str): ret='' for c in str: ret += chr(ord(c)|0x20) if c.isalpha() else c; return ret print (l2u(str)) print (u2l(str))复制代码
评分人数
'a' == 0x60 'A' == 0x40 0xff^0x20 == 0b11111011 0x20 == 0b00000100 'a' & (0xff^0x20) = 'A' 'A' | 0x20 = 'a'复制代码