class Car: speed = 0 def drive(self,dis): time=dis/self.speed print time
car = Car() car.speed=60 car.drive(100)
本文标题:简单的python面向对象
本文链接:https://www.haomeiwen.com/subject/zxzmaxtx.html
网友评论