Duck Typing in Python Dry Run in PYTHON

Duck Typing in Python is an interactive PYTHON dry run visualizer from the Polymorphism programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.

This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.

Duck Typing in Python Program Code

class Duck:
    def swim(self): return "Duck swimming"
    def fly(self): return "Duck flying"

class Whale:
    def swim(self): return "Whale swimming"

def start_swimming(creature):
    print(creature.swim())

start_swimming(Duck())
start_swimming(Whale())

View the complete Polymorphism programs page.

Program Console Duck Typing in Python Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.