python version of group example