01 / 07
The three lines you always write
"I want a new list with everything in this one doubled." Work of that shape comes up constantly.
The way you have it now takes three steps. Make an empty list, loop with for, add with append.
numbers = [1, 2, 3]doubles = []for x in numbers: doubles.append(x * 2)print(doubles)Result
[2, 4, 6]