LearnPy Hub
← Inheritance & Special Methods problems
Hard

Multiple Inheritance

Write mixins Flyer (move() returns 'fly') and Swimmer (move() returns 'swim'). Duck(Flyer, Swimmer) and Penguin(Swimmer). Read a class name and print move() and the MRO class names joined by ' > '.

Input

Duck or Penguin.

Output

Two lines.

Sample 1

Input
Duck
Output
fly
Duck > Flyer > Swimmer > object

Sample 2

Input
Penguin
Output
swim
Penguin > Swimmer > object
solution.py
Output appears here
Multiple Inheritance · Python practice problem · LearnPy Hub