Created
April 5, 2018 12:30
-
-
Save Fhernd/f34a78731cbb72959284438a70ab65e8 to your computer and use it in GitHub Desktop.
Transformación y reducción de datos. OrtizOL.
This file contains 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
numeros = [2, 3, 5, 7, 11, 13] | |
suma_cuadrados = sum(numero * numero for numero in numeros) | |
print(suma_cuadrados) | |
print('') | |
# Comprueba si existen archivos Python | |
# en un directorio dado: | |
import os | |
archivos = os.listdir('/usr/lib/python3.5/') | |
if(any(nombre.endswith('.py') for nombre in archivos)): | |
print('Existen archivos Python en el directorio dado.') | |
else: | |
print('No existen archivos Python en el directorio dado.') | |
print('') | |
datos = ('Python', 3.5, 'x64') | |
print(','.join(str(elemento) for elemento in datos)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment