<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def child_by_code(self, code):
 """ Get child MenuItem by its last path code :param code: :return: MenuItem or None """

        for child in self.childs:
            if child.path.split('/')[-1] == code:
                return child
        return None