Skip to content

Instantly share code, notes, and snippets.

@jorgebastida
Last active October 11, 2015 17:58
Show Gist options
  • Select an option

  • Save jorgebastida/2622580 to your computer and use it in GitHub Desktop.

Select an option

Save jorgebastida/2622580 to your computer and use it in GitHub Desktop.
enjoydjango - Ejercicio Python
#!/usr/bin/env python
"""
Objetivo ....: Mostrar por pantalla el resultado de sumar
todos los digitos contenidos en el fichero
remoto apuntado por la variable URL
Sugerencias .: map(), filter(), int(), sum()
"""
import urllib2
URL = "https://gist.github.com/jorgebastida/2622704/raw/b264cf36cace951cd1ab32c1a783c0c26ff28545/trash.txt"
# 1. cadena pasa a ser un string con el contenido del fichero remoto
cadena = urllib2.urlopen(URL).read()
# 2. Do your magic here!
# 3. Mostrar el resultado
# print suma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment