Python: Difference between sort() and sorted()

Published:

After a bit of a mix up while coding, I had discovered that I was using sort() where I should have used sorted(). Why? Because sort() will sort a list in place, but the return type is NONE, while sorted() will create a new list, leaving the original entities in tact, return type LIST.

Once I figured that out, the Cash 4 Life "all neutral" QP generator works great!

I have not updated the draw history in awhile, but just with the old data it managed to remove 7 outliers. The original script modification also worked out, now I just copy the 5 neutral lists (one per column) directly into the QP Generator where the big list is put together using set() to remove duplicates.

So that was a successful day as far as coding goes! All objectives met and tested. And a big thanks to the stack overflow community for helping to explain the difference between sort() and sorted(). As per usual, I did not need to post anything, just properly use the search there.

Entry #464

Comments

This Blog entry currently has no comments.

Post a Comment

Please Log In

To use this feature you must be logged into your Lottery Post account.

Not a member yet?

If you don't yet have a Lottery Post account, it's simple and free to create one! Just tap the Register button and after a quick process you'll be part of our lottery community.

Register