I'm bored for posting this, but here it is:
def add_commas(str):
str_list = list(str)
str_len = len(str)
for i in range(3, str_len, 3):
str_list.insert(str_len - i, ',')
return ''.join(str_list)
--
http://mail.python.org/mailman/listinfo/python-list
look at xrange -- http://docs.python.org/library/functions.html#xrange
--
http://mail.python.org/mailman/listinfo/python-list
def __str__(self):
output = '%s:%s' % (self.expert_id, self.name)
output += '\nKnown topics: %s' % (', '.join(str(self.topics)))
You're turning your list into a string -- try this:
', '.join([str(x) for x in self.topics])
--
http://mail.python.org/mailman/listinfo/python-list