1 Star 0 Fork 1

王其/托管

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
对象.py 445 Bytes
一键复制 编辑 原始数据 按行查看 历史
王其 提交于 2021-11-15 12:13 +08:00 . add 对象.py.
#coding=utf-8
def start(obj):
obj.speak()
class Animal:
def speak(self):
print("叫啊叫,但不知何物在叫!")
class Dog(Animal):
def speak(self):
print("小狗🐶:汪汪叫")
class Cat(Animal):
def speak(self):
print("小猫🐱:喵喵叫")
class Car(Animal):
def speak(self):
print("小汽车🚗:滴滴叫")
start(Dog())
start(Cat())
start(Car())
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/wang-qi3206/trusteeship.git
git@gitee.com:wang-qi3206/trusteeship.git
wang-qi3206
trusteeship
托管
master

搜索帮助