Python - Constructors and Object Initialization
Which of the following correctly defines a method named
greet that uses self in a Python class?greet that uses self in a Python class?self as the first parameter to access instance data.greet(self). def greet():self. def greet(cls):cls which is for class methods. def greet(self, cls):cls unnecessarily.self as first parameter [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions