|
|
|
|
|
by plorkyeran
4696 days ago
|
|
Off the top of my head: list = ["1", "2", "3"]
sum1 = sum(int(num) for num in list)
sum2 = reduce(map(list, int), operator.add)
sum3 = 0
for num in list:
sum3 += int(num)
Lua only has the third of these three options. I don't really consider this a particularly compelling advantage as a user. |
|