Update sort.py

main function complete