MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __str__

Method __str__

linear_algebra/src/lib.py:66–70  ·  view source on GitHub ↗

returns a string representation of the vector

(self)

Source from the content-addressed store, hash-verified

64 return len(self.__components)
65
66 def __str__(self) -> str:
67 """
68 returns a string representation of the vector
69 """
70 return "(" + ",".join(map(str, self.__components)) + ")"
71
72 def __add__(self, other: Vector) -> Vector:
73 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected