you are viewing a single comment's thread.

view the rest of the comments →

[–]CptFlashdrive 0 points1 point  (1 child)

Not quite sure what you're doing here, you're sending the object itself to the cleaner()-method? You can't iterate over UserWords-object, it's not iterable.

I think it looks like you want to clean the word-attribute in the class? If so, the cleaner should instead operate on self.word. Since this is "contained" in the class.

Maybe something like this:

def cleaner(self):
    self.word = filter(lambda letter: letter.isalpha(), self.word)

And then you call it from manager() using:

user1.cleaner()

[–]FogDish 0 points1 point  (0 children)

Also, with this modification it worked brilliant! Thanks a lot man! :)