Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote