class Person:
def eat(self, food):
print("在吃饭,", self, food)
def eat2(xxxx):
print(xxxx)
p = Person()
# print(p)
# p.eat("土豆")
# print(Person.eat)
# Person.eat(123, "asd")
#
# func = Person.eat()
# func("asd", 999)
p.eat2()
python核心-面向对象-实例方法
最新推荐文章于 2024-07-23 20:40:26 发布