Skip to content

changed readme #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions exercises/38-sort-tuples-ascending/README.es.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# `38` Sort Tuples Ascending
Debe escribir un programa para ordenar las tuplas (nombre, edad, altura) por orden ascendente donde el nombre es `string`, la edad y la altura son `números`.
30 changes: 18 additions & 12 deletions exercises/38-sort-tuples-ascending/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
You are required to write a program to sort the (name, age, height) tuples by ascending order where name is string, age and height are numbers. The tuples are input by console. The sort criteria is:
1: Sort based on name;
2: Then sort based on age;
3: Then sort by score.
# `38` Sort Tuples Ascending


## :pencil: Instructions:
You are required to write a program to sort the (`name`, `age`, `height`) tuples by ascending order where name is `string`, age and height are numbers. The tuples are input by console. The sort criteria is:

1. Sort based on name;
2. Then sort based on age;
3. Then sort by score.
The priority is that name > age > score.
If the following tuples are given as input to the program:
Tom,19,80
John,20,90
Jony,17,91
Jony,17,93
Json,21,85
Then, the output of the program should be:
[('John', '20', '90'), ('Jony', '17', '91'), ('Jony', '17', '93'), ('Json', '21', '85'), ('Tom', '19', '80')]
> - `Tom,19,80`
> - `John,20,90`
> - `Jony,17,91`
> - `Jony,17,93`
> - `Jason,21,85`

> - Then, the output of the program should be:
`[('John', '20', '90'), ('Jony', '17', '91'), ('Jony', '17', '93'), ('Jason', '21', '85'), ('Tom', '19', '80')]`

Hints:
## :bulb: Hint:
In case of input data being supplied to the question, it should be assumed to be a console input.
We use itemgetter to enable multiple sort keys.