When multiplying the Integers of a list, why does this method work?? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

When multiplying the Integers of a list, why does this method work??

>>> reduce(lambda x, y: x*y, [1,2,3,4,5,6]) 720

27th Nov 2016, 6:24 PM
Eric Carlsson
Eric Carlsson - avatar
1 ответ
0
I believe that works because x and y are taken as it moves down the list taking the new number as x and multipling the next number
18th Jun 2017, 2:55 AM
NulledNVoided
NulledNVoided - avatar