Combine flying and swimming
Input
Duck('Daffy', 1.2, 3.4).describe()
Output
Daffy: fly(1.2), swim(3.4)
Duck should collect both behaviors and format them into a single description string.
Full lesson preview
Learn how to use cooperative multiple inheritance with super() to combine behaviors from two parent classes into a single child class.
Problem statement
Task
Examples
Input
Duck('Daffy', 1.2, 3.4).describe()
Output
Daffy: fly(1.2), swim(3.4)
Duck should collect both behaviors and format them into a single description string.
Input format
Output format
Constraints
Samples
Input
Duck('Mallard', 0.8, 2.5).describe()
Output
Mallard: fly(0.8), swim(2.5)
The child Duck exposes both parent behaviors and properly formatted values.