第32044题 单选题
执行以下Python代码,最终的输出结果是?
my_str = "apple,banana,orange"
# 步骤1:将字符串按逗号分割为列表
fruit_list = my_str.split(",")
# 步骤2:将列表用竖线|拼接为新字符串
new_str = "|".join(fruit_list)
# 步骤3:将新字符串前7位转为列表
res = list(new_str[:7])
print(res)
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析