A = [[1,2,3],[4,5,6]]
def addOne(a):
return a+1
addOne(A)
doesn't work, obviously because I don't want A+1,
I want to get [[[2,3,4]],[5,6,7]]
[addone(x) for x in y for y in A]
doesn't work either, I think list comprehensions doesn't work that way.
note, addOne is just a placeholder for a more complicated function