Python Object-Oriented Python Instant Objects Method Interactivity

Ingrid Matthews
Ingrid Matthews
1,465 Points

What does this mean in the context of my code: "argument of the type NoneType is not iterable"? Thanks!

I appreciate the help I've gotten so far. Here's a new error msg and I'm still stuck...

first_class.py
class Student:
    name = "Your Name"

    def praise(self):
        return "You inspire me, {}".format(self.name)

    def reassurance(self):
        return "Chin up, {}. You'll get it next time!".format(self.name)

    def feedback(self, grade):
        if int(grade) > 50:
            self.praise()
        else:
            self.reassurance()
Eldin Guzin
Eldin Guzin
2,504 Points

"argument of type 'NoneType' is not iterable". That message probably refers to a loop or membership operator, but I don't see either in this code.Anyways you dont have a "grade" variable set in the first place and keep in mind you need to make it iterable, and also you need to set it before the functions

1 Answer

Steven Parker
Steven Parker
201,320 Points

You're pretty close, but the instructions asked that you "return the result of the [selected] method."
Right now, the correct method is being called, but the result is not being returned.

The confusing error message apparently relates to something done in the internal testing that we never see.