Python

1、类、子类与函数定义: 

class Animal(object): # object 继承object类。
    Paw=True
    Age=1
    def Eat(self,a):
        print(a)

class Tiger(Animal): # object 继承Animal类。
Address="Forest"

 2、初始化函数_init_

class User(object):
    Name="aa"
    def __init__(self):
        self.Name="b"

 

你可能感兴趣的:(python)