如何将字符串从python3.6转换为旧版本?

2024-10-01 19:29:10 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用python3.6,但是对于这项工作,我需要使用Python的旧版本

如果可能的话,我想把这一行(python3.6)转换成一个旧版本:

for uniref in [f">{chunk.rstrip()}" 
   for chunk in data.split(">")]:

我试过了

for uniref in [">{chunk.rstrip()}" 
    for chunk in data.split(">").format(chunk.rstrip())]:

但是我收到了这个错误信息AttributeError: 'list' object has no attribute 'format'


Tags: noinformatfordataobjectattributelist

热门问题