Skip to content

Commit 6edb7aa

Browse files
committed
更新"".join(list)答案的描述
>### 为什么是string.join(list)而不是list.join(string) >问题 [链接](http://stackoverflow.com/questions/493819/python-join->why-is-it-string-joinlist-instead-of-list-joinstring) > > my_list = ["Hello", "world"] > print "-".join(my_list) > #为什么不是 my_list.join("-") 。。。。这个.... > >答案: > >因为所有可迭代对象都可以被连接,但是连接者总是字符串 ----- 答案是不是改成这样会好一些: >因为所有可迭代对象都可以被连接,而不只是列表,但是连接者总是字符串 这样会更明确一些.
1 parent c5d2ae9 commit 6edb7aa

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

contents/qa-string.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
### 为什么是string.join(list)而不是list.join(string)
32

43
问题 [链接](http://stackoverflow.com/questions/493819/python-join-why-is-it-string-joinlist-instead-of-list-joinstring)
@@ -9,7 +8,7 @@
98

109
答案:
1110

12-
因为所有可迭代对象都可以被连接,但是连接者总是字符串
11+
因为所有可迭代对象都可以被连接,而不只是列表,但是连接者总是字符串
1312

1413
### 字符如何转为小写
1514

0 commit comments

Comments
 (0)