how to append to a list twice?

Edward Elliott nobody at 127.0.0.1
Fri Apr 21 12:49:04 EDT 2006


John Salerno wrote:
 > If I want to create a list of the form [100, 99, 99, 98, 98, 97, 97...]
 > (where each item is repeated twice after the first one), how might I do
 > that most efficiently?

Why not just this:

series = [x/2 for x in range(200, 1, -1)]



More information about the Python-list mailing list