ValueError: Unknown format code 'b' for object of type 'str'

前端 未结 0 420
执笔经年
执笔经年 2020-12-23 22:46

Trying to convert string to binary and divide in chunks.

def toBin(string):
    return \'\'.join(format(x, \'b\').zfill(8) for x in string)

def chunkstring(s         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题