Non Linear Data Structure In Python