from abc import ABCMeta, abstractmethod"""This serves as a template for Lab #2 - Strategy for Musical Instruments"""################################################################################ Instruments###############################################################################"""The Instrument interface contains one class variable named play_behaviorand three methods: display, play and s
...[Show More]
from abc import ABCMeta, abstractmethod
"""This serves as a template for Lab #2 - Strategy for Musical Instruments"""
##############################################################################
#
# Instruments
##############################################################################
#
"""The Instrument interface contains one class variable named play_behavior
and three methods: display, play and set_play_behavior"""
class Instrument:
__metaclass__ = ABCMeta
# please include the class variable and the three required methods here
@abstractmethod
def display(self):
pass
def play(self):
pass
def set_play_behavior(self):
pass
"""DoubleBass Class"""
class DoubleBass(Instrument):
def __init__(self):
self.play_behavior = PlayWithBow()
def display(self):
print("I am a double bass.")
def play(self):
PlayWithBow.play(self)
"""Clarinet Class"""
class Clarinet(Instrument):
def __init__(self):
self.play_behavior = BuzzAReed()
def display(self):
print("I am a clarinet.")
def play(self):
BuzzAReed.play(self)
[Show Less]