To solve mathematical sorting algorithms by python