fork download
  1. def performOps(A):
  2. m = len(A)
  3. n = len(A[0])
  4. B = []
  5. for i in xrange(len(A)):
  6. B.append([0] * n)
  7. for j in xrange(len(A[i])):
  8. B[i][n - 1 - j] = A[i][j]
  9. return B
  10.  
  11. A = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]
  12. B = performOps(A)
  13. for i in xrange(len(B)):
  14. for j in xrange(len(B[i])):
  15. print B[i][j],
Success #stdin #stdout 0.04s 63596KB
stdin
Standard input is empty
stdout
4 3 2 1 8 7 6 5 12 11 10 9