-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist.py
More file actions
37 lines (24 loc) · 902 Bytes
/
list.py
File metadata and controls
37 lines (24 loc) · 902 Bytes
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
cities = ['davao', 'manila', 'cebu', 'digos', 'midsayap', 'pigawayan']
# mycities = ['calinan','baguio']
# cities.append(['tacurong','isulan', 'gensan'])
# print "this will add three fruits", cities
cities_append(cities);
def cities_extend(cities):
cities.extend(["toril","calinan"])
print "this will add toril and calinan in the citiest list using extend", cities
return
cities_extend(cities);
def cities_insert(cities):
cities.insert(2, "tamayong")
print "This will insert tamayong in index 2", cities
return
cities_insert(cities);
def cities_remove(cities):
cities.remove("tamayong")
print "this will remove tamayong in the list", cities
cities_remove(cities)
def cities_pop(cities):
cities.pop()
print "this will remove calinan in the last same ", cities
return
cities_pop(cities)