MCPcopy Index your code
hub / github.com/geekcomputers/Python / __str__

Method __str__

linear-algebra-python/src/lib.py:282–295  ·  view source on GitHub ↗

returns a string representation of this matrix.

(self)

Source from the content-addressed store, hash-verified

280 self.__height = h
281
282 def __str__(self):
283 """
284 returns a string representation of this
285 matrix.
286 """
287 ans = ""
288 for i in range(self.__height):
289 ans += "|"
290 for j in range(self.__width):
291 if j < self.__width - 1:
292 ans += str(self.__matrix[i][j]) + ","
293 else:
294 ans += str(self.__matrix[i][j]) + "|\n"
295 return ans
296
297 def changeComponent(self, x, y, value):
298 """

Callers 2

test_str_matrixMethod · 0.95

Calls

no outgoing calls

Tested by 2

test_str_matrixMethod · 0.76