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.159 tracks/python/exercises/matrix/example.py
trackler-2.2.1.158 tracks/python/exercises/matrix/example.py
trackler-2.2.1.157 tracks/python/exercises/matrix/example.py
trackler-2.2.1.156 tracks/python/exercises/matrix/example.py
trackler-2.2.1.155 tracks/python/exercises/matrix/example.py
trackler-2.2.1.154 tracks/python/exercises/matrix/example.py
trackler-2.2.1.153 tracks/python/exercises/matrix/example.py
trackler-2.2.1.152 tracks/python/exercises/matrix/example.py
trackler-2.2.1.151 tracks/python/exercises/matrix/example.py
trackler-2.2.1.150 tracks/python/exercises/matrix/example.py
trackler-2.2.1.149 tracks/python/exercises/matrix/example.py
trackler-2.2.1.148 tracks/python/exercises/matrix/example.py
trackler-2.2.1.147 tracks/python/exercises/matrix/example.py
trackler-2.2.1.146 tracks/python/exercises/matrix/example.py
trackler-2.2.1.145 tracks/python/exercises/matrix/example.py
trackler-2.2.1.144 tracks/python/exercises/matrix/example.py
trackler-2.2.1.143 tracks/python/exercises/matrix/example.py
trackler-2.2.1.142 tracks/python/exercises/matrix/example.py
trackler-2.2.1.141 tracks/python/exercises/matrix/example.py
trackler-2.2.1.140 tracks/python/exercises/matrix/example.py