Basic data structure codes in python