Created
March 9, 2017 16:10
-
-
Save hector117/69673e933689e8a6a09a482427bb707b to your computer and use it in GitHub Desktop.
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
def contador(nombre): | |
# direccion = '/Users/Hector Santillan/Desktop/python/' + nombre | |
direccion = nombre | |
abierto = open(direccion,'r') | |
texto = abierto.read() | |
lista = len(texto.split("\n")) | |
tupla = (lista,len(texto)) | |
abierto.close() | |
return tupla | |
#main program below | |
print("WSQ-09") | |
nombre = input("Ingresa el nombre del archivo") | |
a = contador(nombre)[0] | |
b = contador(nombre)[1] | |
print("El numero de caracteres es de %1d y hay %1d lineas " % (b,a)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment