标签:pytho span col can triangle 案例 nbsp sha style
class Canvas: def draw_pic(self, shape): print(‘--start draw--‘) shape.draw(self) class Rectangle: def draw(self, canvas): print(‘draw rectangle on %s‘ % canvas) class Triangle: def draw(self, canvas): print(‘draw triangle on %s‘ % canvas) class Circle: def draw(self, canvas): print(‘draw circle on %s‘ % canvas) c = Canvas() c.draw_pic(Rectangle()) c.draw_pic(Triangle()) c.draw_pic(Circle())
谢谢!
标签:pytho span col can triangle 案例 nbsp sha style
原文地址:https://www.cnblogs.com/zhzhang/p/11899745.html