Skip to content

Instantly share code, notes, and snippets.

View molarmanful's full-sized avatar
🐉

Ben Pang molarmanful

🐉
View GitHub Profile
let hintcharacters = "asdfjkl;"
unmap w P W o <S-Esc> ? E Y i I \ [ ] = - 0 | t p x J K u s S / n N H L .
matrix = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
matrix[2][1] # => 8
for row in matrix:
print(*row)
rep = [' '.join(map(str, matrix[r:r + cols])) for r in range(0, len(matrix), cols)]
for r in range(len(matrix)):
for c in range(len(r)):
matrix[r][c] += 1
new_matrix = []
new_rows = 9
new_cols = 1
temp = []
for row in matrix:
temp += row
for r in range(new_rows):
new_matrix.append([temp[r * new_cols + c] for c in range(new_cols)])
temp = []
for row in matrix:
temp += row
temp[r * new_cols + c]
rows = 3
cols = 3
matrix = [
1, 2, 3,
4, 5, 6,
7, 8, 9
]