Adventures in Pythonland.
M = [[1,2,3], [4,5,6], [7,8,9]]
# diagonal
[M[i][i] for i in len(0, len(M))]
# reverse diagonal
[M[i][-(i+1)] for i len(0, len(M)]
from string import maketrans
inTable = "abcde"
outTable = "12345"
t = maketrans(inTable, outTable)
'abracadabrace'.trabslate(t) # '12r131412r135'
n = 356 - 189; print(len([i for i in range(2, n / 2 + 1) if n % i == 0])) == 0 # It is A PRIME!
python -c 'print(True);print(False)'