Feb-20-2019, 06:44 PM
Cool, but as I said, doing stuff index by index is not pythonic. Here's two other ways to solve the problem:
def matrixflip(m, d): if d == 'v': return m[::-1] elif d == 'h': return [row[::-1] for row in m] else: return m[:]or:
def matrixflip(m, d): if d == 'v': return reversed(m) elif d == 'h': return [reversed(row) for row in m] else: return m[:]
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures