-
Notifications
You must be signed in to change notification settings - Fork 0
/
simpleTest.txt
97 lines (89 loc) · 2.38 KB
/
simpleTest.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
>>> movies = ["The Holy Grail",
"The Life of Brian",
"The Meaning of Life"]
>>> print movies[1]
The Life of Brian
>>> print movies
['The Holy Grail', 'The Life of Brian', 'The Meaning of Life']
>>> print len(movies)
3
>>> mov = movies
>>> print mov
['The Holy Grail', 'The Life of Brian', 'The Meaning of Life']
>>> mov.append("The Holly Wood")
>>> print mov
['The Holy Grail', 'The Life of Brian', 'The Meaning of Life', 'The Holly Wood']
>>> mov.pop
<built-in method pop of list object at 0x10a0358c0>
>>> mov.pop()
'The Holly Wood'
>>> print mov
['The Holy Grail', 'The Life of Brian', 'The Meaning of Life']
>>> mov.extend(mov)
>>> print mov
['The Holy Grail', 'The Life of Brian', 'The Meaning of Life', 'The Holy Grail', 'The Life of Brian', 'The Meaning of Life']
>>> mov.remove("The Holy Grail")
>>> print mov
['The Life of Brian', 'The Meaning of Life', 'The Holy Grail', 'The Life of Brian', 'The Meaning of Life']
>>> mov.insert(0, 'The Holy Grail')
>>> print mov
['The Holy Grail', 'The Life of Brian', 'The Meaning of Life', 'The Holy Grail', 'The Life of Brian', 'The Meaning of Life']
>>>
>>> movies = ['The Holy Grail', 1975, 'Terry Jones & Terry Gilliam', 91,
['Graham Chapman',
['Michael Palin', 'Johh Cleese', 'Terry Gillam', 'Eric Idle', 'Terry Jones']]]
>>>
>>> print movies
['The Holy Grail', 1975, 'Terry Jones & Terry Gilliam', 91, ['Graham Chapman', ['Michael Palin', 'Johh Cleese', 'Terry Gillam', 'Eric Idle', 'Terry Jones']]]
>>>
>>> mov = movies
>>>
>>> for each in mov:
print each
The Holy Grail
1975
Terry Jones & Terry Gilliam
91
['Graham Chapman', ['Michael Palin', 'Johh Cleese', 'Terry Gillam', 'Eric Idle', 'Terry Jones']]
>>>
>>> isinstance(mov, list)
True
>>>
>>> for each in mov:
if isinstance(each, list):
for each_iter in each:
print each_iter
else:
print each
The Holy Grail
1975
Terry Jones & Terry Gilliam
91
Graham Chapman
['Michael Palin', 'Johh Cleese', 'Terry Gillam', 'Eric Idle', 'Terry Jones']
>>>
>>>
>>> def print_lol(the_list):
for each_item in the_list:
if isinstance(each_item, list):
print_lol(each_item)
else:
print each_item
>>> print_lol(mov)
The Holy Grail
1975
Terry Jones & Terry Gilliam
91
Graham Chapman
Michael Palin
Johh Cleese
Terry Gillam
Eric Idle
Terry Jones
>>>
inoremap ( ()<ESC>i
inoremap [ []<ESC>i
inoremap { {}<ESC>i
inoremap < <><ESC>i
inoremap " ""<ESC>i
inoremap ' ''<ESC>i