You can just use a list comprehension:

Copymy_list = [1, 2, 3, 4, 5]
my_new_list = [i * 5 for i in my_list]

>>> print(my_new_list)
[5, 10, 15, 20, 25]

Note that a list comprehension is generally a more efficient way to do a for loop:

Copymy_new_list = []
for i in my_list:
    my_new_list.append(i * 5)

>>> print(my_new_list)
[5, 10, 15, 20, 25]

As an alternative, here is a solution using the popular Pandas package:

Copyimport pandas as pd

s = pd.Series(my_list)

>>> s * 5
0     5
1    10
2    15
3    20
4    25
dtype: int64

Or, if you just want the list:

Copy>>> (s * 5).tolist()
[5, 10, 15, 20, 25]

Finally, one could use map, although this is generally frowned upon.

Copymy_new_list = map(lambda x: x * 5, my_list)

Using map, however, is generally less efficient. Per a comment from ShadowRanger on a deleted answer to this question:

The reason "no one" uses it is that, in general, it's a performance pessimization. The only time it's worth considering map in CPython is if you're using a built-in function implemented in C as the mapping function; otherwise, map is going to run equal to or slower than the more Pythonic listcomp or genexpr (which are also more explicit about whether they're lazy generators or eager list creators; on Py3, your code wouldn't work without wrapping the map call in list). If you're using map with a lambda function, stop, you're doing it wrong.

And another one of his comments posted to this reply:

Please don't teach people to use map with lambda; the instant you need a lambda, you'd have been better off with a list comprehension or generator expression. If you're clever, you can make map work without lambdas a lot, e.g. in this case, map((5).__mul__, my_list), although in this particular case, thanks to some optimizations in the byte code interpreter for simple int math, [x * 5 for x in my_list] is faster, as well as being more Pythonic and simpler.

Answer from Alexander on Stack Overflow
Top answer
1 of 10
203

You can just use a list comprehension:

Copymy_list = [1, 2, 3, 4, 5]
my_new_list = [i * 5 for i in my_list]

>>> print(my_new_list)
[5, 10, 15, 20, 25]

Note that a list comprehension is generally a more efficient way to do a for loop:

Copymy_new_list = []
for i in my_list:
    my_new_list.append(i * 5)

>>> print(my_new_list)
[5, 10, 15, 20, 25]

As an alternative, here is a solution using the popular Pandas package:

Copyimport pandas as pd

s = pd.Series(my_list)

>>> s * 5
0     5
1    10
2    15
3    20
4    25
dtype: int64

Or, if you just want the list:

Copy>>> (s * 5).tolist()
[5, 10, 15, 20, 25]

Finally, one could use map, although this is generally frowned upon.

Copymy_new_list = map(lambda x: x * 5, my_list)

Using map, however, is generally less efficient. Per a comment from ShadowRanger on a deleted answer to this question:

The reason "no one" uses it is that, in general, it's a performance pessimization. The only time it's worth considering map in CPython is if you're using a built-in function implemented in C as the mapping function; otherwise, map is going to run equal to or slower than the more Pythonic listcomp or genexpr (which are also more explicit about whether they're lazy generators or eager list creators; on Py3, your code wouldn't work without wrapping the map call in list). If you're using map with a lambda function, stop, you're doing it wrong.

And another one of his comments posted to this reply:

Please don't teach people to use map with lambda; the instant you need a lambda, you'd have been better off with a list comprehension or generator expression. If you're clever, you can make map work without lambdas a lot, e.g. in this case, map((5).__mul__, my_list), although in this particular case, thanks to some optimizations in the byte code interpreter for simple int math, [x * 5 for x in my_list] is faster, as well as being more Pythonic and simpler.

2 of 10
39

A blazingly faster approach is to do the multiplication in a vectorized manner instead of looping over the list. Numpy has already provided a very simply and handy way for this that you can use.

Copy>>> import numpy as np
>>> 
>>> my_list = np.array([1, 2, 3, 4, 5])
>>> 
>>> my_list * 5
array([ 5, 10, 15, 20, 25])

Note that this doesn't work with Python's native lists. If you multiply a number with a list it will repeat the items of the as the size of that number.

CopyIn [15]: my_list *= 1000

In [16]: len(my_list)
Out[16]: 5000

If you want a pure Python-based approach using a list comprehension is basically the most Pythonic way to go.

CopyIn [6]: my_list = [1, 2, 3, 4, 5]

In [7]: [5 * i for i in my_list]
Out[7]: [5, 10, 15, 20, 25]

Beside list comprehension, as a pure functional approach, you can also use built-in map() function as following:

CopyIn [10]: list(map((5).__mul__, my_list))
Out[10]: [5, 10, 15, 20, 25]

This code passes all the items within the my_list to 5's __mul__ method and returns an iterator-like object (in python-3.x). You can then convert the iterator to list using list() built in function (in Python-2.x you don't need that because map return a list by default).

benchmarks:

CopyIn [18]: %timeit [5 * i for i in my_list]
463 ns ± 10.6 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)

In [19]: %timeit list(map((5).__mul__, my_list))
784 ns ± 10.7 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)

In [20]: %timeit [5 * i for i in my_list * 100000]
20.8 ms ± 115 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)

In [21]: %timeit list(map((5).__mul__, my_list * 100000))
30.6 ms ± 169 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)


In [24]: arr = np.array(my_list * 100000)

In [25]: %timeit arr * 5
899 µs ± 4.98 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-multiply-numbers-list-3-different-ways
Multiply All Numbers in the List in Python - GeeksforGeeks
Explanation: start with res = 1 and then multiply each number in the list with res using a for loop.
Published   October 28, 2025
🌐
Coding Confessions
blog.codingconfessions.com › confessions of a code addict › why do python lists multiply oddly? a cpython internals deep dive
Why Do Python Lists Multiply Oddly? Exploring the CPython Source Code
April 26, 2024 - In Python, the * operator when used on a sequence type object (such as lists, strings), repeats the elements of the object x number of times.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-multiply-two-list
Python - Multiply Two Lists - GeeksforGeeks
July 12, 2025 - map() function applies a lambda function to each pair of elements from lists a and b multiplying them together. Result is converted to a list producing [4, 10, 18], where each element is the product of corresponding elements from a and b. Comment · Article Tags: Article Tags: Python ·
Find elsewhere
🌐
CodeGym
codegym.cc › java blog › learning python › multiply in python
Multiply in Python
August 14, 2024 - The reduce function from the functools module can be used to apply a function (in this case, multiplication) cumulatively to the items of the list, from left to right. from functools import reduce from operator import mul numbers = [2, 3, 4] result = reduce(mul, numbers) print(result) # Output: 24 · In Python 3.8 and later, the math module provides the prod function, which can be used directly on a list to get the product of all elements.
🌐
4Geeks
4geeks.com › how-to › how-to-multiply-in-Python
How to multiply in python
July 16, 2025 - Learn how to multiply in Python using various methods, from the simple asterisk operator to advanced libraries like NumPy. Master your coding skills today!
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › python list multiply
Python List Multiply - Spark By {Examples}
May 31, 2024 - You can use different approaches of Python to multiply list elements in Python. One of the approaches is multiplying each element of a list by a number
🌐
TutorialsPoint
tutorialspoint.com › article › python-program-to-multiply-all-numbers-in-the-list
Python program to multiply all numbers in the list?
March 24, 2026 - The operator.mul() function provides another way to multiply numbers when combined with a loop ? from operator import mul numbers = [2, -3, 3, 2, 4, 5, 3] print('The list is:', numbers) product = 1 for num in numbers: product = mul(num, product) print('The product is:', product) The list is: [2, -3, 3, 2, 4, 5, 3] The product is: -2160 · For Python 3.8+, use math.prod() for the simplest solution.
🌐
Plain English
python.plainenglish.io › how-to-quickly-multiply-elements-in-a-list-in-python-16a2bd7205be
How to Quickly Multiply Elements in a List in Python | by Fatos Morina | Python in Plain English
February 10, 2022 - New Python content every day. Follow to join our 3.5M+ monthly readers. ... If you happen to learn programming from a textbook, you may have seen an example where you are told to exercise writing a quick program that allows you to find the product of elements, for example: If you however want to find the product of all elements in a list, you need to iterate through that list in the following way:
🌐
Quora
quora.com › How-do-I-multiply-two-lists-in-Python
How to multiply two lists in Python - Quora
Answer: list1 and list2 are the two veriable decleration list1 = [1, 2, 3] list2 = [4, 5, 6] products = [] initialize result list. #declear array products for multiplication for num1, num2 in zip(list1, list2): //looping through the array of list1 and list2 products. append(num1 * num2) //ap...
🌐
TutorialsPoint
tutorialspoint.com › article › python-repeat-and-multiply-list-extension
Python - Repeat and Multiply List Extension
March 27, 2026 - Python provides several methods to repeat and multiply list elements. This article explores different approaches to extend lists by repeating elements or multiplying their values.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-multiplying-alternate-elements-in-list
Python | Multiplying Alternate elements in List - GeeksforGeeks
April 9, 2023 - We can have list comprehension to get run the logic and list slicing can slice out the alternate character, product by the external prod function. ... # Python3 code to demonstrate # Multiplying Alternate elements in List # using list comprehension + list slicing # getting Product def prod(val) : res = 1 for ele in val: res *= ele return res # initializing list test_list = [2, 1, 5, 6, 8, 10] # printing original list print("The original list : " + str(test_list)) # using list comprehension + list slicing # Multiplying Alternate elements in List res = [prod(test_list[i : : 2]) for i in range(len(test_list) // (len(test_list)//2))] # print result print("The alternate elements product list : " + str(res))
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › multiply all numbers in python list
Multiply all Numbers in Python List - Spark By {Examples}
May 31, 2024 - How to multiply all numbers in the Python list? You can use the multiplication operator (*) is indeed used for multiplying two numbers together. It can be
🌐
Python documentation
docs.python.org › 3 › library › random.html
random — Generate pseudo-random numbers
May 18, 2026 - Complementary-Multiply-with-Carry recipe for a compatible alternative random number generator with a long period and comparatively simple update operations.
🌐
TutorialsPoint
tutorialspoint.com › article › multiplying-alternate-elements-in-a-list-using-python
Multiplying Alternate elements in a List using Python?
March 27, 2026 - The iterative approach uses a loop to traverse the list and multiply elements at even indices.
🌐
TutorialsPoint
tutorialspoint.com › article › python-multiply-each-element-in-a-sublist-by-its-index
Python-Multiply each element in a sublist by its index
March 27, 2026 - import numpy as np def multiply_by_index_numpy(sublists): sublists_array = np.array(sublists) indices = np.arange(len(sublists)) multiplied_array = sublists_array * indices[:, np.newaxis] return multiplied_array.tolist() # Example usage sublists = [[7, 2, 8], [4, 5, 6], [3, 8, 9]] result = multiply_by_index_numpy(sublists) print("Result:", result) ... Use for loops for simple cases and maximum readability. Choose NumPy for large datasets requiring optimal performance. List comprehension offers a good balance between conciseness and performance for medium-sized data.