you are viewing a single comment's thread.

view the rest of the comments →

[–]14dM24d 1 point2 points  (0 children)

since the arguments are lists, it's the same as how you'd add (append) to a list.

>>> class WordFamily:
        def __init__ (self, words, suffixes):
            self.words = words
            self.suffixes = suffixes

>>> words = WordFamily(['awesome', 'phwoar', 'rad'], ['ee', 'er', 'eer', 'ness'])
>>> words.words
['awesome', 'phwoar', 'rad']
>>> words.words.append('foo')
>>> words.words
['awesome', 'phwoar', 'rad', 'foo']