sort function

25 views
Skip to first unread message

Paul Maxwell

unread,
Jul 27, 2021, 4:38:16 AM7/27/21
to Project Jupyter
Hi all i am very new to Python and juypter notebook. i am trying to use the sort function  with a list of names, however when i use (names.sort()
and then i print names i just get the same result the names have not been sorted?
i must be doing something wrong but ii thnk i need help? 

Jason Moore

unread,
Jul 27, 2021, 4:50:11 AM7/27/21
to jup...@googlegroups.com
Paul,

You may want to read this:


sorted() and .sort() have different behaviors, maybe you are looking for a particular case. .sort() will modify in place and printing that variable after the method call should show a sorted list.

Jason


--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/181ab2e2-4f46-4fb9-a2f0-1947e4f53151n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages