classAnimal(object):defrun(self):print("I can run")classDog(Animal):defrun(self):print("dog can run")classCat(Animal):defrun(self):print("cat can run")deftest(animal):
animal.run()
a=Animal()
b=Dog()
c=Cat()print(isinstance(b, Animal))#isinstance()用来判断一个量是否是相应的类型
test(a)
test(b)