Skip to content

Instantly share code, notes, and snippets.

@voroninman
Last active October 21, 2015 17:20
Show Gist options
  • Save voroninman/270ad747d619d71297da to your computer and use it in GitHub Desktop.
Save voroninman/270ad747d619d71297da to your computer and use it in GitHub Desktop.
from functools import reduce
checkio = lambda number: reduce(lambda x, y: x * y,
filter(lambda digit: digit,
map(int, str(number))))
assert checkio(1) == 1, 'The simplest one'
assert checkio(10) == 1, 'With zero'
assert checkio(234) == 24, '234'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment