Predict 字符串拆分
预测输出 简单
题目
什么做 这个 code print?
代码
csv = "a,b,c,d"
parts = csv.split(",")
print(parts)
print(len(parts))
提示
拆分() breaks 字符串 at 每个 delimiter.
解释
split(",") breaks the string at each comma, producing ["", "b", "c", "d"]. len(parts) is 4. Output: ['a', 'b', 'c', 'd'] then 4.
相关资源
相关课程
- 字符串
字符串拆分.
查阅不认识的术语
新手友好的术语表用大白话解释编程术语——变量、函数、DOM、Promise 等等。
解读错误信息
用大白话解释常见错误——什么意思、为什么发生、如何修复。
动手做项目
通过引导式项目应用所学,含起始代码与解决方案。