\(\renewcommand\AA{\unicode{x212B}}\)
The aim of this exercise is to familiarise you with the use of objects within Python.
Detector
class contains two attributes: id and name. The
attributes should be able to be set by a call like:
Detector(1, "bank1_1")
.Instrument('MyInst', dets)
.Instrument
class called printTree
that will
print the names & ids of the detectors contained within itComponent
that stores a single name attributeInstrument
& Detector
classes to use Component
as a super class and share its name attributeprintTree
method still functions correctly.Once finished check your answer with the provided Exercise 1 Solutions