Skip to content

Commit d24d763

Browse files
committed
Updates chapter1.md
Auto commit by GitBook Editor
1 parent efe3143 commit d24d763

File tree

2 files changed

+57
-6
lines changed

2 files changed

+57
-6
lines changed

SUMMARY.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Summary
22

3-
* [First Chapter](chapter1.md)
4-
5-
3+
* [Introduction](README.md)
4+
* [20170626](chapter1.md)
65

chapter1.md

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Python note
1+
# Python note
22

3-
# H5群集資料型態
3+
#
44

5-
H4 len\( \) 以一個int物件傳回資料項的長度
5+
---
6+
7+
len\( \) 以一個int物件傳回資料項的長度
68

79
>>>len\(\(“one”,\)\)
810

@@ -16,3 +18,53 @@ H4 len\( \) 以一個int物件傳回資料項的長度
1618

1719
13
1820

21+
---
22+
23+
list型態 有個append\(\)方法,可以將一個物件附加至一個清單
24+
25+
就像這樣:
26+
27+
>>> x = \["zebra",49,-897,"arrvark",200\]
28+
29+
>>> x.append\("more"\)
30+
31+
>>> x
32+
33+
\['zebra', 49, -897, 'arrvark', 200, 'more’\]
34+
35+
list型態 有 insert\(\) 用於將一個資料項插入被給定的索引位置
36+
37+
還有 remove\(\) 用於從被給定的索引位置移除一個資料項
38+
39+
python 的 索引是從 0 開始
40+
41+
>>> x
42+
43+
\['zebra', 49, -897, 'arrvark', 200, 'more’\]
44+
45+
>>> x\[1\]
46+
47+
49
48+
49+
>>> x\[1\] = "forty nine"
50+
51+
>>> x
52+
53+
\['zebra', 'forty nine', -897, 'arrvark', 200, 'more’\]
54+
55+
---
56+
57+
58+
59+
60+
61+
62+
63+
64+
65+
66+
67+
68+
69+
70+

0 commit comments

Comments
 (0)