###### 3.9.1 - Lists in Python
# Python List Examples

a = [] #Empty List

b = [0, 1, 2, 3, 4] #List with 5 items

c = [3.14, "abc", [1, 2, 3, 4]]  #List with a nested list

d = list('Python')  # List of iterable items

e = list(range(0, 10))  # List of integers from 0-9

len(b)
len(c[2])

b + c
c + b

b * 4

3.14 in c

b[2] = 9 # mutable

temp_string = "Python"

temp_string[2] = "a" # error inmutable

c[2][0]

c[2][-1]

b[1:]
b[:2]
b[1:3]

a = [] #Empty List

b = [0, 1, 2, 3, 4] #List with 5 items

c = [3.14, "abc", [1, 2, 3, 4]] #List with a nested list

d = list('Python') # List of iterable items

d

// Result: ['P', 'y', 't', 'h', 'o', 'n'] //

e = list(range(0, 10)) # List of integers from 0-9

e

// Result: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] //

len(b)

// Result: 5 //

len(c[2])

// Result: 4 //

b + c

// Result: [0, 1, 2, 3, 4, 3.14, 'abc', [1, 2, 3, 4]] //

c + b

// Result: [3.14, 'abc', [1, 2, 3, 4], 0, 1, 2, 3, 4] //

b * 4

// Result: [0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4] //

3.14 in c

// Result: True //

b[2] = 9 # mutable

b

// Result: [0, 1, 9, 3, 4] //

c[2][0]

// Result: 1 //

c[2][-1]

// Result: 4 //

b[1:]

// Result: [1, 9, 3, 4] //

b[:2]

// Result: [0, 1] //

b[1:3]

// Result: [1, 9] //

#### LeetCode 160 — Intersection of Two Linked Lists（C++ Python）

2014-12-02 20:59:16

#### [leetcode]Intersection of Two Linked Lists　——　熟悉python

2014-12-11 11:41:03

#### 21. Merge Two Sorted Lists（python）

2016-09-18 21:32:17

#### leetcode 160: Intersection of Two Linked Lists

2014-12-30 03:17:29

#### [LeetCode] 021. Merge Two Sorted Lists (Easy) (C++/Python)

2015-03-04 20:11:32

#### 160. Intersection of Two Linked Lists（python）

2016-09-18 21:38:02

#### [Leetcode]23. Merge k Sorted Lists @python

2016-01-16 15:32:14

#### Unpacking Argument Lists

2010-12-01 10:43:00

#### [LeetCode] 023. Merge k Sorted Lists (Hard) (C++/Java/Python)

2015-03-05 11:19:11

#### leetcode python - addTwoNumbers

2017-04-01 11:35:24

## 不良信息举报

3.9.1 - Lists in Python