0
Fill in the blanks to make sayHi() a class method.
class Person: def __init__(self, name): self.name = name (_____________) (__)sayHi(cls): print("Hi")
5 Antworten
+ 2
I think the answer is already in your question.
+ 7
class Person:
def __init__(self, name):
self.name = name
@classmethod
def sayHi(cls):
print("Hi")
+ 2
thx!
+ 1
IT DOESNT WORK
+ 1
question : Fill in the blanks to make sayHi() a class method.
program : class person:
def __init__(self,name):
self.name = name
@classmethod
def sayhi(cls):
print("hi")