Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ejercicios-clase-02-datos
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rafael Andrei Vinasco Soler
ejercicios-clase-02-datos
Commits
5ff71ab4
Commit
5ff71ab4
authored
4 years ago
by
Rafael Andrei Vinasco Soler
Browse files
Options
Downloads
Patches
Plain Diff
ejercicio 1 con comentarios extras explicativos
parent
dec09a6f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ejercicio1.ipynb
+4
-4
4 additions, 4 deletions
ejercicio1.ipynb
with
4 additions
and
4 deletions
ejercicio1.ipynb
+
4
−
4
View file @
5ff71ab4
...
@@ -31,13 +31,13 @@
...
@@ -31,13 +31,13 @@
}
}
],
],
"source": [
"source": [
"lista1 = lista.split('-')\n",
"lista1 = lista.split('-')
## creo una lista de los elementos ingresados usando '-' como separador
\n",
"\n",
"\n",
"lista_ordenada = sorted(lista1) \n",
"lista_ordenada = sorted(lista1)
#organizo la lista alfabeticamente
\n",
"\n",
"\n",
"print_punto1 = \"-\".join(lista_ordenada)\n",
"print_punto1 = \"-\".join(lista_ordenada)
#separo la lista en un string con un separador '-' para cada elemento
\n",
"\n",
"\n",
"print(print_punto1)"
"print(print_punto1)
#imprimo
"
]
]
},
},
{
{
...
...
%% 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
```
```
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment