Use a list comprehension: [value / divisor for value in values]. It divides each item with Python’s true-division operator and returns a new list, leaving the original list unchanged.
Divide every list element with a list comprehension
For an ordinary Python list, no extra package is needed:
As an Amazon Associate I earn from qualifying purchases.
values = [10, 20, 30]
divisor = 5
result = [value / divisor for value in values]
print(result) # [2.0, 4.0, 6.0]
print(values) # [10, 20, 30]
The expression loops over values, divides each value by divisor, and collects the results into a new list. To bind the result back to the same variable name, assign it explicitly: values = [value / divisor for value in values].
Choose between true division and floor division
Python’s / operator performs true division, so a result can include a fractional part. Use // when you specifically want floor division, which rounds the quotient down toward negative infinity.
#1 Best Overall
values = [5, 7, 9]
divisor = 2
ordinary = [x / divisor for x in values] # [2.5, 3.5, 4.5]
floored = [x // divisor for x in values] # [2, 3, 4]
For negative values, floor division is not the same as truncating toward zero: for example, -5 // 2 is -3. See Python’s operator reference for the distinction between true division and floor division.
When to use map
map applies a function to each item, but returns an iterator rather than a list. Wrap it in list() if you need a list immediately:
Rank #2
values = [10, 20, 30]
divisor = 5
result = list(map(lambda x: x / divisor, values))
For a simple arithmetic operation, the list comprehension is usually easier to read. map can be a natural choice when you already have a named function to apply. Python documents map and list comprehensions in its built-in functions reference.
Free tools Windows power users keep installed
One-click scans. No signup required.
When NumPy makes sense
If your data is already a NumPy array, dividing it by a scalar operates element by element and keeps the result as an array:
import numpy as np
values = np.array([10, 20, 30])
result = values / 5
NumPy’s quickstart guide covers element-wise array operations. For a short built-in Python list, a comprehension is sufficient; NumPy is useful when the broader task calls for array computing.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




