Sorry, I should’ve been more clear with my example; I only meant for it to be a substitute for the printed line, not the entire block. Your initial code is correct as far as creating an array ‘news_articles’ with all the articles, and then populating a second array ‘articles’ with a random selection from the first. The problem only occurs when you try to print ‘articles’ as-is, because Ren’Py’s idea of printing an array doesn’t necessarily match what the user would expect the output to look like.
A full example would be closer to this:
articles = renpy.random.sample(news_articles, 3)
“It takes a while to read today’s news. The articles include [articles], [articles], and [articles].”
In this case, ‘articles’ is still a selection of three random items from the larger news_articles array. But since printing it with [articles] doesn’t work the way we want it to, we directly print the individual items in the ‘articles’ array instead. It’s not the most elegant solution, but unless you’re going to try to directly print a lot of different arrays into dialogue boxes, it’s a much more feasible solution than overriding how arrays are printed.