Logo
Explore Help
Register Sign In
exercism/python
1
0
Fork 0
You've already forked python
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
b48d415f67d42914576bb510fcfcab749cd65a77
python/exercises/matrix/example.py

12 lines
341 B
Python
Raw Normal View History

python matrix added.
2014-03-18 05:34:18 +01:00
class Matrix(object):
def __init__(self, s):
self.rows = [[int(n) for n in row.split()]
for row in s.split('\n')]
matrix: re-implement to conform with canonical data (#1297) * matrix: Rewrite tests to match canonical v1.0.0 * matrix: add necessary methods to stub file * matrix: fix example to pass tests v1.0.0
2018-02-17 04:03:08 +08:00
self.columns = [list(tup) for tup in zip(*self.rows)]
python matrix added.
2014-03-18 05:34:18 +01:00
matrix: re-implement to conform with canonical data (#1297) * matrix: Rewrite tests to match canonical v1.0.0 * matrix: add necessary methods to stub file * matrix: fix example to pass tests v1.0.0
2018-02-17 04:03:08 +08:00
def row(self, index):
Matrix: update tests to 1.1.0 (#1651) Fixes #1645
2019-01-14 10:22:45 -06:00
return self.rows[index - 1]
matrix: re-implement to conform with canonical data (#1297) * matrix: Rewrite tests to match canonical v1.0.0 * matrix: add necessary methods to stub file * matrix: fix example to pass tests v1.0.0
2018-02-17 04:03:08 +08:00
def column(self, index):
Matrix: update tests to 1.1.0 (#1651) Fixes #1645
2019-01-14 10:22:45 -06:00
return self.columns[index - 1]
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 138ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API