with open("datos.txt", "r") as fichero: lineas = fichero.readlines() print(f"Número de líneas: {len(lineas)}")