Sunday, August 16, 2020

IslandT: A python module to sort a number list

This python module will help you to sort any numbers within a list, either integer or double type, or a mix of both.

For example, if you enter this list, [3.4, -4, 3.5, 7, 14] and pass in True as the second parameter to the below function.

import intesort as sortx

print(sortx.intesort([3.4, -4, 3.5, 7, 14], True))

You will get [-4, 3.4, 3.5, 7, 14] in return where this function will sort the list in the ascending order. If you pass in False then the outcome will be [14, 7, 3.5, 3.4, -4] instead. If you do not pass in the second parameter then the function will assume you want an ascending order list. If you do not pass in anything to the above function, then this function will return [].

You can download this module on PyPI through below command on your command prompt. Enjoy!

pip install intesort


from Planet Python
via read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...