NameError: name 'reduce' is not defined in Python

前端 未结 5 731
萌比男神i
萌比男神i 2020-11-29 17:49

I\'m using Python 3.2. Tried this:

xor = lambda x,y: (x+y)%2
l = reduce(xor, [1,2,3,4])

And got the following error:

l = re         


        
5条回答
提交回复
热议问题