DrSchool Learn coding, fast.
EN AR BN CS DE EL Search

Arrays / Lists — Example 44

Quick explanation + ready code for: Arrays / Lists.

Python Arrays / Lists Back to examples
Back to language
Syntax: Arrays / Lists in Python. ID: #44

Code

items = [17, 18, 19]
print([x*2 for x in items])

Notes

You can copy this snippet and adapt it. For advanced, add real-world inputs, edge cases, and tests.