Python 3.6: What is the different between these two list comprehension calculations? : So, I'm still relatively new to python, and mostly self-taught.  I've been running my own statistical analyses, but I'm curious as to why there are different outputs for the following two list comprehensions.  I am using Jupyter Notebook on Ubuntu LTS 16.04:

Input: 

"example = [[15, 16, 17],
           [18, 19, 20]]

list1 = [item[0] + item[1] + item[2] for item in example]

for item in example:

    list2 = [item[0] + item[1] + item[2]]
    
list1, list2"    

Output: ([48, 57], [57])

Clearly the second function is printing the sum of the second row, but why not the first?