Jump to content

LearnPythonTheHardWay ex25 Help

Go to solution Solved by SIGSEGV,

def sort_words(words):

"""Sorts the words."""

return sorted(words)

By calling that little snippet there

Here is the link to exercise 25: http://learnpythonthehardway.org/book/ex25.html

 

So I followed the entire thing, typed in all the code and ran it like I was supposed to. No problem there.

 

I just don't understand how he alphabetized the words. I probably should mention this is my first language I am learning.

 

I can't see how that happened in the code.

 

If someone could explain how he did that that would be awesome. 

Link to comment
https://linustechtips.com/topic/318009-learnpythonthehardway-ex25-help/
Share on other sites

Link to post
Share on other sites

def sort_words(words):    """Sorts the words."""    return sorted(words)
By calling that little snippet there

 

 

 

https://wiki.python.org/moin/HowTo/Sorting

 

"

def sort_words(words):    """Sorts the words."""    return sorted(words)"

That returns the items in sorted order

Lol... I thought it was a lot more complicated thanks! :D

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×