Skip to main content
2 of 2
Formatted code
MarcoB
  • 67.7k
  • 18
  • 96
  • 198

In this case you are printing the InputForm of whatever expression you give to Print. So if you want to print the String "1, 2, 3" then you will need to construct that String to print.

The following does what you need (and works for any number of Lists of elements):

a = {1};
b = {2, 3};

str = StringRiffle[Join[a, b], ", "]

Yields

1, 2, 3

And if you want to Print this (which may not be the right tool in the first place depending on what you want to do), then you can just Print[ str ] and it will do what you want.

The idea is to join the lists together and then separate them by commas as a String.

Hope this helps!

enano9314
  • 543
  • 4
  • 9