Last active
August 29, 2015 13:56
-
-
Save shizone/8993820 to your computer and use it in GitHub Desktop.
Check iOのRegistrationで怒られた
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python3.3 is inside | |
def checkio(els): | |
return reduce(lambda x,y: x+y, els[0:3]) | |
if checkio([1, 2, 3, 4, 5, 6]) == 6: | |
print('Done!') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python3.3 is inside | |
def checkio(els): | |
from functools import reduce | |
return reduce(lambda x,y: x+y, els[0:3]) | |
if checkio([1, 2, 3, 4, 5, 6]) == 6: | |
print('Done!') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python3.3 is inside | |
def checkio(els): | |
return sum(els[0:3]) | |
if checkio([1, 2, 3, 4, 5, 6]) == 6: | |
print('Done!') |
Author
shizone
commented
Feb 14, 2014
単純に3系でreduceがfunctoolsに移ったかららしい
あべさんにsumでいいんじゃね?と言われたので
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment