Skip to content
Snippets Groups Projects
Commit 5ff71ab4 authored by Rafael Andrei Vinasco Soler's avatar Rafael Andrei Vinasco Soler
Browse files

ejercicio 1 con comentarios extras explicativos

parent dec09a6f
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
lista = input('Ingrese los nombres separados por -:') lista = input('Ingrese los nombres separados por -:')
``` ```
%% Output %% Output
Ingrese los nombres separados por -:aa-ss-dd-ff-ere-ww-ss-aa-ss Ingrese los nombres separados por -:aa-ss-dd-ff-ere-ww-ss-aa-ss
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
lista1 = lista.split('-') lista1 = lista.split('-') ## creo una lista de los elementos ingresados usando '-' como separador
lista_ordenada = sorted(lista1) lista_ordenada = sorted(lista1) #organizo la lista alfabeticamente
print_punto1 = "-".join(lista_ordenada) print_punto1 = "-".join(lista_ordenada) #separo la lista en un string con un separador '-' para cada elemento
print(print_punto1) print(print_punto1) #imprimo
``` ```
%% Output %% Output
aa-aa-dd-ere-ff-ss-ss-ss-ww aa-aa-dd-ere-ff-ss-ss-ss-ww
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment