请问为什么print(",".join([1,2,3,4,5])会运行失败
数据类型不匹配
.join 操作时针对字符串的,你的数组中全是int类型,不是 str 类型
','.join([str(n) for n in [1,2,3,4,5]) 你需要把类型转成 str 才能 join