Python Object-Oriented Python Instant Objects Your first method

Nikolai Alzate
Nikolai Alzate
4,554 Points

Your First Method, Python Objects

I keep getting the rather unhelpful message "Try Again!" I have no understanding of what to do here.

first_class.py
class Student:
    name = "Niko"
    def praise(self.name):
        print("Great job, {}!".format(self.name))
        return

1 Answer

Steven Parker
Steven Parker
177,843 Points

You're close, but:

  • name is a instance variable, so you don't need it as a parameter (just "self")
  • the function should return the created string
  • you don't need to "print" anything