+ 1
To subtract numbers in the list Python
To subtract a number from immediate next number in the list.Example we have a list [5,4,3,2]. First it subtract 4-5 equal to -1. Then subtract 3- (-1)"which is result of previous substraction" gives 4 and finally subtract 2-4 that gives -2.
2 Respostas
+ 3
Sounds like a job for functools.reduce to me!
https://www.geeksforgeeks.org/reduce-in-JUMP_LINK__&&__python__&&__JUMP_LINK/
+ 4
and question is? ;-)