To subtract numbers in the list Python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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.

3rd Feb 2019, 9:42 AM
Haider
2 Answers
3rd Feb 2019, 9:45 AM
HonFu
HonFu - avatar
+ 4
and question is? ;-)
3rd Feb 2019, 9:45 AM
Hubert Dudek
Hubert Dudek - avatar