>>> matrix = [ ... [1, 2, 5, 7, 9], ... [25, 67, 78, 23, 34], ... [33, 22, 66, 88, 98], ... [32, 31, 41, 56, 78], ... [21, 34, 58, 99, 76], ... ] >>> for item in [[row[i] for row in matrix] for i in range(5)]: ... print item ... [1, 25, 33, 32, 21] [2, 67, 22, 31, 34] [5, 78, 66, 41, 58] [7, 23, 88, 56, 99] [9, 34, 98, 78, 76] >>>
2014-03-31 22:36 GMT+08:00 Hardik Gandhi <hgandhi7...@yahoo.com>: > > > Hello, > > > > Can some one help me with displaying a matrix vertically. > > > > For example my output matrix is:- > > > > [1 2 5 7 9] > > [25 67 78 23 34] > > [33 22 66 88 98] > > [32 31 41 56 78] > > [21 34 58 99 76] > > > > And i want my matrix to look like this:- > > [1 25 33 32 21] > > [2 67 22 31 34] > > [5 78 66 41 58] > > [7 23 88 56 99] > > [9 34 98 78 76] > > > > Please, help me with the code in eclipse using py-dev as preference. > > > > Thank you > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor