sorting words in python -
Is not it possible to sort the list of words according to the English alphabet in Python, but according to the self-generated alphabet /p>
You can define custom comparison methods in general so that your restrictions can be sorted. I have never coded one line of Python in my life, but it is very similar to Ruby that to help me notice that the following part can help you:
Alphabet = "zyxwvrrrrrrpkfnnjjgfedcba" inputWords = "" England "," France "," Spain "," Italy "," Greece "," Portal "," Canada "," USA "," Mexico "," Peru " Cuba "," Chile "," Argentina "," Zimbabwe "," Juganda "," Congo "," Zambia "," Namibia "," Cube "] was printed (e) The word kaput, key = lambda word: [word for [alphabet.index (c)) word
You may also want to check. Good luck!
Comments
Post a Comment