SyntaxFix
Write A Post
Hire A Developer
Questions
You can also use reduce method:
>>> myList = [3, 5, 4, 9] >>> myTotal = reduce(lambda x,y: x+y, myList) >>> myTotal 21
Furthermore, you can modify the lambda function to do other operations on your list.