Skip to content

csit08/widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

polymorphism with inheritance

class widget: def render(self): pass

class Button(widget): def render(self): print("Rendering a button")

class TextBox(widget): def render(self): print("Rendering a text box")

widgets = [Button(), TextBox()] for widget in widgets: widget.render() # outputs "Rendering a button" and "Rendering a text box"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published