[pythonvis] Re: Short projet

  • From: derek riemer <driemer.riemer@xxxxxxxxx>
  • To: pythonvis@xxxxxxxxxxxxx
  • Date: Tue, 02 Jun 2015 08:33:29 -0600

Oddly enough, I needed a variant this function that splits a 1 dimentional string into a 2 dimentional array of row length 10 yesterday and wrote it. but I will hold off posting it in case anyone wishes to write it.

On 5/31/2015 7:58 PM, Jim Snowbarger wrote:


Anybody want to take a crack at this one?

Write a function that takes a list, of indefinite size. The list elements consist of numbers, in the range of 1 to 100, but you have no idea how many list elements there will be. Typical list But, as a sample, lengths might be 50 elements at most.

Process the list, and print the output in a series of lines that do not exceed 32 characters each.

Numbers on each line should be separated by a single space, and a number should not span multiple lines.

Because the numbers are in the range of 1 through 100, some numbers take fewer spaces than others, That is, the number 1 should be written as “1” not “001” , nor be space padded, such as “ 1”. Think of packing numbers together in the interests of conserving braille display real estate.

If anybody takes it on, let me know.


Other related posts: