Introduction to sorting algorithm in python