位置:首頁 > 軟件操作教程 > 編程開發(fā) > Python > 問題詳情

python豐富你的類

提問人:楊紫紅發(fā)布時間:2020-11-18

class Animals(Animate):

    def breathe(self):

        print('breathing')

    def move(self):

        print('moving')

    def eat_food(self):

        print('eating food')


class Mammals(Animals):

    def feed_young_with_milk(self):

        print('feeding young')


class Giraffes(Mammals):

    def eat_leaves_from_trees(self):

        print('eating leaves')

繼續(xù)查找其他問題的答案?

相關(guān)視頻回答
回復(fù)(0)
返回頂部