Last active
October 4, 2015 10:38
-
-
Save jorgebastida/2622601 to your computer and use it in GitHub Desktop.
enjoydjango - Ejercicio Resuelto
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
| #!/usr/bin/env python | |
| import urllib2 | |
| URL = "https://gist.github.com/jorgebastida/2622704/raw/b264cf36cace951cd1ab32c1a783c0c26ff28545/trash.txt" | |
| def es_digito(num): | |
| return num in "0123456789" | |
| cadena = urllib2.urlopen(URL).read() | |
| cadena = filter(es_digito, cadena) | |
| digitos = map(int, cadena) | |
| print sum(digitos) |
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
| 224679 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment