Within the list of elements for obtaining the sum

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/lipachong/article/details/102754494
total = 0
list1 = [2, 3, 5]
for x in range(0, len(list1)):
    total = total + list1[x]
print( total)

Guess you like

Origin blog.csdn.net/lipachong/article/details/102754494
Recommended