class Person:
def __init__(self, name):
self.name = name
def sayHi(self):
print(‘Hello, my name is‘+ self.name)
p = Person(‘Swaroop‘)
p.sayHi()
时间: 2024-10-11 07:00:52
class Person:
def __init__(self, name):
self.name = name
def sayHi(self):
print(‘Hello, my name is‘+ self.name)
p = Person(‘Swaroop‘)
p.sayHi()