<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create(self, list_id, title, rulegroups):
 """Creates a new segment."""

        body = {
            "Title": title,
            "RuleGroups": rulegroups}
        response = self._post("/segments/%s.json" % list_id, json.dumps(body))
        self.segment_id = json_to_py(response)
        return self.segment_id