Python - Constructors and Object Initialization
Consider this class:
What is the output?
class Gadget:
def __init__(self, name='Gizmo', features=None):
if features is None:
features = ['Bluetooth', 'WiFi']
self.name = name
self.features = features
g1 = Gadget()
g2 = Gadget(features=['GPS'])
print(g1.features, g2.features)What is the output?
