-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-list.py
More file actions
executable file
·76 lines (46 loc) · 1.46 KB
/
test-list.py
File metadata and controls
executable file
·76 lines (46 loc) · 1.46 KB
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
#! /usr/bin/python
test_list_1 = ['python', '-', 'izm', '.', 'com']
print test_list_1
print '------------------------------------------------------------'
for i in test_list_1:
print i
test_list_2 = []
print test_list_2
print '------------------------------------------------------------'
test_list_2.append('python')
test_list_2.append('-')
test_list_2.append('izm')
test_list_2.append('.')
test_list_2.append('com')
print test_list_2
test_list_3 = ['python', 'izm', 'com']
print test_list_3
print '------------------------------------------------------------'
test_list_3.insert(1, '-')
test_list_3.insert(3, '.')
print test_list_3
test_list_3.insert(0, 'http://www.')
print test_list_3
test_list_4 = ['1', '2', '3', '2', '1']
print test_list_4
print '------------------------------------------------------------'
test_list_4.remove('2')
print test_list_4
test_list_5 = ['1', '2', '3', '2', '1']
print test_list_5
print '------------------------------------------------------------'
print test_list_5.pop(1)
print test_list_5
print test_list_5.pop()
print test_list_5
test_list_6 = ['1', '2', '3', '2', '1']
print test_list_6
print '------------------------------------------------------------'
print test_list_6.index('2')
test_list_7 = ['1', '2', '3', '2', '1']
print test_list_7
print '------------------------------------------------------------'
print test_list_7.count('2')
for i in range(test_list_7.count('2')):
test_list_7.remove('2')
print test_list_7