So for your particular problem, you would put the print function outside the for loop because you just want to print the final product which is the largest prime factor of the number 600851475143. And in your code you're appending to the list which again means you should put the print function outside the for loop like below:
list =[0]
for i in range(2,600851475143):
if(600851475143%i==0):
list.append(i)
print(list)
If you put it inside, you would be printing "i" each time it is getting looped and added to the list and you don't want that:
list =[0]
for i in range(2,600851475143):
if(600851475143%i==0):
list.append(i)
print(list)