Skip to content

Commit a8ee444

Browse files
📝 更新文档,优化内容与结构
- 从`.gitignore`中移除`table.py`,清理不必要的忽略项。 - 在Python文档中增加字符串拼接与乘法扩展的示例,提升内容的实用性。 - 更新列表和字典的相关文档,增加方法分类和示例,增强信息的清晰度与可读性。 - 新增`pprint`模块的详细介绍,包含基本用法、核心函数及实际应用示例,提升文档的完整性与实用性。
1 parent 2282d45 commit a8ee444

File tree

4 files changed

+492
-217
lines changed

4 files changed

+492
-217
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
.env.development.local
1515
.env.test.local
1616
.env.production.local
17-
table.py
1817

1918
npm-debug.log*
2019
yarn-debug.log*

docs/docs/选择编程语言/Python/2字符串.mdx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ print(string)
5252
不可变的,这意味着每次修改都会创建新字符串。
5353

5454
序列对象,表示拥有一些共性方法:
55-
- 加法拼接,返回新的字符串
55+
- 加法拼接与乘法扩展(大部分序列对象都实现此方法),返回新的字符串
5656
- 索引,返回单个字符
5757
- 切片,返回新的字符串
5858
- 可遍历,每次返回单个字符
@@ -61,6 +61,12 @@ print(string)
6161

6262
```python showLineNumbers
6363
s = 'good morning'
64+
# 字符串的拼接
65+
s[:-3] + s[-3:] # good morning
66+
67+
# 字符串的乘法扩展
68+
'-' * 2 # --
69+
6470
# 字符串的索引
6571
s[0] # g
6672
s[-2] # n
@@ -70,9 +76,6 @@ s[-3:] # ing
7076
s[:-3] # good morn
7177
s[:] # good morning
7278

73-
# 字符串的拼接
74-
s[:-3] + s[-3:] # good morning
75-
7679
# 遍历
7780
for i in s:
7881
print(i,end=' ')

0 commit comments

Comments
 (0)