nums = [1,2,3] sum(2*x for x in nums)
I didn't know that I could write it, so I made a note.
Actually
(2*x for x in nums)
Is created and passed to the function,
sum((2*x for x in nums))
Same as.
Recommended Posts