I want to format a function that creates a map using a list with width ,and 2D l
ID: 3552066 • Letter: I
Question
I want to format a function that creates a map using a list with width ,and 2D lists:
list=[[2,3,8],[1,4,9]], gives
[ 2 3 8 ]
[ 1 4 9 ]
list=[[2, 333, 8],[21, 4, 9]]
[ 2 333 8 ]
[ 21 4 9 ]
Notice that the number paddings each element have is equal to the length of the longest element and are lined up to the right. There is space before and after the closed bracket.
list=[2,3,4,5,6,2]3
[ 2 30 4 ]
[ 5 6 2 ]
Notice here it devided the list in to width of three.The padding is the same as above
list=[2,333,8,21,4,9]2
[ 2 333 ]
[ 8 21 ]
[ 4 9 ]
Explanation / Answer
The solution is here:
http://pastebin.com/5tcA9gkZ
The modification made the program easier and simpler. ^_^
THIS IS OLD SOLUTION!
http://pastebin.com/wgixTkwR
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.