input: index (start at 0) output: the i-th component of the vector.
(self, i)
| 79 | return ans |
| 80 | |
| 81 | def component(self, i): |
| 82 | """ |
| 83 | input: index (start at 0) |
| 84 | output: the i-th component of the vector. |
| 85 | """ |
| 86 | if i < len(self.__components) and i >= 0: |
| 87 | return self.__components[i] |
| 88 | else: |
| 89 | raise Exception("index out of range") |
| 90 | |
| 91 | def size(self): |
| 92 | """ |
no outgoing calls