使用块大小将字符串转换为 ASCII

时间:2021-06-22 06:42:16

标签: string ascii

我想将字符串转换为 ASCII 代码,如下所述。我已经实现了编码和解码功能,但我不明白块大小是多少?我该如何实施?

任务说明: description

编码和解码功能:

def encode(text, block_size):
    PL = []
    for char in text:
        PL.append(ord(char))
    return PL

def decode(PL, block_size):
    text = ''.join(map(chr,PL))
    return text

0 个答案:

没有答案
相关问题