returns a string representation of the vector
(self)
| 64 | raise Exception("please give any vector") |
| 65 | |
| 66 | def __str__(self): |
| 67 | """ |
| 68 | returns a string representation of the vector |
| 69 | """ |
| 70 | ans = "(" |
| 71 | length = len(self.__components) |
| 72 | for i in range(length): |
| 73 | if i != length - 1: |
| 74 | ans += str(self.__components[i]) + "," |
| 75 | else: |
| 76 | ans += str(self.__components[i]) + ")" |
| 77 | if len(ans) == 1: |
| 78 | ans += ")" |
| 79 | return ans |
| 80 | |
| 81 | def component(self, i): |
| 82 | """ |
no outgoing calls