Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list = []
- for row in rows:
- c = list_of_categories.index(row["id"])
- print c
- list[c] = row["name"]
- d = {}
- for row in rows:
- c = list_of_categories.index(row["id"])
- print c
- d[c] = row["name"]
- d = dict((list_of_categories.index(row['id']), row['name']) for row in rows)
- print d
- n = 3
- array = n * [None]
- print array
- array[2] = 11
- array[1] = 47
- array[0] = 42
- print array
- [None, None, None]
- [42, 47, 11]
- l = list ()
- l.append ("foo")
- l.append (3)
- print (l)
- l = list ()
- l.append ("foo")
- l.append (3)
- l.insert (1, "new")
- print (l)
- lst = [0] * n
- lst = [some_object() for i in xrange(n)]
- for i in xrange(n):
- lst[i] += 1
- dict = {'a': 1, 'b': 2, 'c': 3}
- dict['a']
- lst = [list_of_categories.index(row["id"]) for row in rows]
- list = {}
- for row in rows:
- c = list_of_categories.index(row["id"])
- print c
- list[c] = row["name"]
- for x in list.values():
- print x
- if 3 in list:
- print "it's there"
- class MyList(UserList.UserList):
- NO_ITEM = 'noitem'
- def insertAt(self, item, index):
- length = len(self)
- if index < length:
- self[index] = item
- elif index == length:
- self.append(item)
- else:
- for i in range(0, index-length):
- self.append(self.NO_ITEM)
- self.append(item)
Add Comment
Please, Sign In to add comment