- 博客(3)
- 收藏
- 关注
原创 python去掉头尾的空格
Whitespace includes all Unicode whitespace characters, such as spaces, tabs (\t), carriage returns (\r), and newlines (\n). The Python str() class has the following methods that you can use to trim whitespace from a string:strip([chars]): Trims characters
2024-01-23 17:39:19
419
原创 Python按照元素顺序合并list
一、普通list合并将两个或多个list合并,通常最常用的就是直接相加: list1 = ["v1-1", "v1-2", "v1-3"] list2 = ["v2-1", "v2-2", "v2-3"] list3 = ["v3-1", "v3-2"] tmp = list1 + list2 + list3 print(tmp)相加的结果就是[list1的所有元素, list2的所有元素,list3的所有元素]:[‘v1-1’, ‘v1-2’, ‘v1-3
2020-07-21 22:09:13
3439
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人