How do I print the sum of an append list in python. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How do I print the sum of an append list in python.

This code is correct, but I would like to make it print the sum of the append list. list = [7,1,2,3,4,5,6,7] even_list = [] for i in list: if i % 2 == 0: even_list.append(i) print(even_list)

10th Jan 2020, 6:11 PM
Thomas B1046
Thomas B1046 - avatar
1 Answer
+ 1
The output would be as follows; 2 4 6 Instead of 12😆
10th Jan 2020, 6:37 PM
Thomas B1046
Thomas B1046 - avatar