def fun_with_snakes(questionnaire, predispositioned, cut_out, reinitiate_from_the_beginning): isolated_snakes_info = {'habitat': [], 'diet': []}; for snake in questionnaire: if snake['predispositioned'] == 'friendly' and snake not in cut_out: isolated_snakes_info['habitat'].append(snake['habitat']); isolated_snakes_info['diet'].append(snake['diet']); reinitiate_from_the_beginning = true; return isolated_snakes_info