0
Sorting
how can we sort using second string in a set of list. list1=["willy","Cooper","Ram","hell"] out put should be based on second letter of each word i.e I, o, a, e list1=["Ram","hell","willy","Cooper"]
3 Answers
+ 4
Write whatever sort you like and instead of comparing first > second use first[1:] > second[1:]. string[1:] creates a substring of the second character to the end.
+ 2
A sort must compare the strings. I'm telling you how to ignore the first character when you do your compare.
0
didn't get u. r u asking me to compare a string?
Hot today
Python — File Handling
0 Votes
Help me solve this (using loop)
3 Votes
What is wrong? Error on test.
1 Votes
Help me wiht python
1 Votes
Question is write a c program to print prime numbers up to n and print the largest number in array.
1 Votes
Help me
0 Votes