10 Réponses
+ 3
hi Pranjal, can you please provide a list as sample so that we can get a feeling what you want to achieve? Thanks.
+ 3
hi Pranjal, I have prepared for you some code attached in a py file. When you run it in Playground, you will be prompted for an input. Enter a name and an age, separated by comma. e.g. Claude,54
Code is with comments and also output is with some information. Hope this helps.
https://code.sololearn.com/cKA5lpr9ICqR/?ref=app
+ 2
Pranjal, thanks for your information. That helps. A last question:
if you say:
I want to arrange them with :
1. Key = Name
2. Key = Age
does this mean that you want to get them sorted by Name OR by Age?
Or do you mean that the key for sorting should be a combination of both ‘fields’ : Name + Age?
+ 2
Pranjal, if you like - yes!
0
Let there be n=3 names with their ages :
John 22
Dave 26
Robert 20
I want to arrange them with :
1. Key = Name
2. Key = Age
here there are 3 inputs.. i want for n inputs
0
~ swim ~
I got you earlier but my question was something different.
0
Lothar
I want to give user an option, whether they want to sort by name or by age . In both the cases, key will be different .
Also, when i'll print the sorted list, i want the complete info to be printed !!
0
Ok. Thanks a lot Lothar !!
Should i send you my code too ?