Python 面向对象 编程(一)
class fuc:
def multi(self,x):
return x*x
def greet(self, name):
print ('i am',name)
lg = fuc()
lg.multi(5)
Out[46]: 25
lg.greet('luogan')
i am luogan
class fuc:
def multi(self,x):
return x*x
def greet(self, name):
print ('i am',name)
lg = fuc()
lg.multi(5)
Out[46]: 25
lg.greet('luogan')
i am luogan