Sha256: e441ac6d63672ea9d736e1b1f103044d5b0ab0631aeaee966cfee81728e17858

Contents?: true

Size: 333 Bytes

Versions: 73

Compression:

Stored size: 333 Bytes

Contents

class Matrix(object):
    def __init__(self, s):
        self.rows = [[int(n) for n in row.split()]
                     for row in s.split('\n')]
        self.columns = [list(tup) for tup in zip(*self.rows)]

    def row(self, index):
        return self.rows[index]

    def column(self, index):
        return self.columns[index]

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
trackler-2.2.1.119 tracks/python/exercises/matrix/example.py
trackler-2.2.1.118 tracks/python/exercises/matrix/example.py
trackler-2.2.1.117 tracks/python/exercises/matrix/example.py
trackler-2.2.1.116 tracks/python/exercises/matrix/example.py
trackler-2.2.1.115 tracks/python/exercises/matrix/example.py
trackler-2.2.1.114 tracks/python/exercises/matrix/example.py
trackler-2.2.1.113 tracks/python/exercises/matrix/example.py
trackler-2.2.1.111 tracks/python/exercises/matrix/example.py
trackler-2.2.1.110 tracks/python/exercises/matrix/example.py
trackler-2.2.1.109 tracks/python/exercises/matrix/example.py
trackler-2.2.1.108 tracks/python/exercises/matrix/example.py
trackler-2.2.1.107 tracks/python/exercises/matrix/example.py
trackler-2.2.1.106 tracks/python/exercises/matrix/example.py