Python3.4のオブジェクト向け


class Hello:
    #      +       
    def __init__(self,name):
        self.name = name

    def sayHello(self):
        print("Hello {0}".format(self.name))

#   
class Hi(Hello):
    def __init__(self, name):
        Hello.__init__(self, name)

    def sayHi(self):
        print("Hi {0}".format(self.name))

#     Hello   
h = Hello("  ")
#     sayHello   
h.sayHello()

h1 = Hi("ZHANG SAN")
h1.sayHi()