运行 ❯
获取您的
自有 Python
服务器
×
更改方向
更改主题,深色/浅色
进入 Spaces
class Person: def __init__(self, fname, lname): self.firstname = fname self.lastname = lname def printname(self): print(self.firstname, self.lastname) #Use the Person class to create an object, and then execute the printname method: x = Person("John", "Doe") x.printname()
约翰·杜