标签:print tom 形参 init pre def int abc show
class Person:
x = ‘abc‘
def __init__(self, name, age=19):
self.name = name
self.y = age
#print("pengjai")
def show(self,y):
# print(x)
Person.x = y
tom=Person("jia")
tom.show(2) #self就是实例化对象
Person.show(2,8) #直接将self当做形参来
标签:print tom 形参 init pre def int abc show
原文地址:https://www.cnblogs.com/pengwa1226/p/10296780.html