fork(1) download
  1. lists = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
  2.  
  3. def format_list(items):
  4. list_contents = ' '.join(str(it) for it in items) # convert contents to string too
  5. return '[{}]'.format(list_contents) # wrap in brackets
  6.  
  7. formatted = format_list(format_list(l) for l in lists)
  8.  
  9. print formatted
Success #stdin #stdout 0.09s 10840KB
stdin
Standard input is empty
stdout
[[1 2 3] [4 5 6] [7 8 9]]