tags:

views:

279

answers:

2

I need to multiply a list by 2.

I tested the code unsuccessfully:

2 * List
+2  A: 

Do you want to multiply each element by 2? That would be:

[2*i for i in List]
sykora
A: 

or:

import numpy

numpy.multiply(List, 2)

Richard Larsson