<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fasta(self):
 """Generates a FASTA string for the `Assembly`. Notes ----- Explanation of FASTA format: https://en.wikipedia.org/wiki/FASTA_format Recommendation that all lines of text be shorter than 80 characters is adhered to. Format of PDBID|CHAIN|SEQUENCE is consistent with files downloaded from the PDB. Uppercase PDBID used for consistency with files downloaded from the PDB. Useful for feeding into cdhit and then running sequence clustering. Returns ------- fasta_str : str String of the fasta file for the `Assembly`. """

        fasta_str = ''
        max_line_length = 79
        for p in self._molecules:
            if hasattr(p, 'sequence'):
                fasta_str += '>{0}:{1}|PDBID|CHAIN|SEQUENCE\n'.format(
                    self.id.upper(), p.id)
                seq = p.sequence
                split_seq = [seq[i: i + max_line_length]
                             for i in range(0, len(seq), max_line_length)]
                for seq_part in split_seq:
                    fasta_str += '{0}\n'.format(seq_part)
        return fasta_str