【发布时间】:2021-08-11 19:45:53
【问题描述】:
我在ord() def 中遇到问题,我的代码如下:
def write(data):
for block_idx in list(range(0, len(data), 10)):
chksum = 0
for byte_idx in list(range(block_idx, 2)):
chksum += ord(data[byte_idx])
write(b'123')
TypeError: ord() expected string of length 1, but int found
【问题讨论】:
标签: python