python code for dividing the list by size.