| 149 | |
| 150 | print("Example 11") |
| 151 | class FixedResistance(Resistor): |
| 152 | def __init__(self, ohms): |
| 153 | super().__init__(ohms) |
| 154 | |
| 155 | @property |
| 156 | def ohms(self): |
| 157 | return self._ohms |
| 158 | |
| 159 | @ohms.setter |
| 160 | def ohms(self, ohms): |
| 161 | if hasattr(self, "_ohms"): |
| 162 | raise AttributeError("Ohms is immutable") |
| 163 | self._ohms = ohms |
| 164 | |
| 165 | |
| 166 | print("Example 12") |