\begin{Verbatim}[commandchars=\\\{\}]
\PYG{k+kn}{from} \PYG{n+nn}{Bio} \PYG{k+kn}{import} \PYG{n}{SeqIO}

\PYG{n}{records} \PYG{o}{=} \PYG{n+nb}{list}\PYG{p}{(}\PYG{n}{SeqIO}\PYG{o}{.}\PYG{n}{parse}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}ls\PYGZus{}orchid.gbk\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}genbank\PYGZdq{}}\PYG{p}{))}

\PYG{k}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}Found }\PYG{l+s+si}{\PYGZpc{}i}\PYG{l+s+s2}{ records\PYGZdq{}} \PYG{o}{\PYGZpc{}} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{records}\PYG{p}{))}

\PYG{k}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}The last record\PYGZdq{}}\PYG{p}{)}
\PYG{n}{last\PYGZus{}record} \PYG{o}{=} \PYG{n}{records}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{]}  \PYG{c+c1}{\PYGZsh{} using Python\PYGZsq{}s list tricks}
\PYG{k}{print}\PYG{p}{(}\PYG{n}{last\PYGZus{}record}\PYG{o}{.}\PYG{n}{id}\PYG{p}{)}
\PYG{k}{print}\PYG{p}{(}\PYG{n+nb}{repr}\PYG{p}{(}\PYG{n}{last\PYGZus{}record}\PYG{o}{.}\PYG{n}{seq}\PYG{p}{))}
\PYG{k}{print}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{last\PYGZus{}record}\PYG{p}{))}

\PYG{k}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}The first record\PYGZdq{}}\PYG{p}{)}
\PYG{n}{first\PYGZus{}record} \PYG{o}{=} \PYG{n}{records}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}  \PYG{c+c1}{\PYGZsh{} remember, Python counts from zero}
\PYG{k}{print}\PYG{p}{(}\PYG{n}{first\PYGZus{}record}\PYG{o}{.}\PYG{n}{id}\PYG{p}{)}
\PYG{k}{print}\PYG{p}{(}\PYG{n+nb}{repr}\PYG{p}{(}\PYG{n}{first\PYGZus{}record}\PYG{o}{.}\PYG{n}{seq}\PYG{p}{))}
\PYG{k}{print}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{first\PYGZus{}record}\PYG{p}{))}
\end{Verbatim}
