파이썬(python) 클래스(class)와 self


print "hi"
class Service:
secret = "1111111"
def setname(self, name):
self.name = name
def sum(self, a, b):
result = a + b
print self.name, a, b, result

pey = Service()
pey.setname("aaa")
pey.sum(1,3)                
             

0 댓글