Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gmcninch-tufts
GitHub Repository: gmcninch-tufts/2024-Sp-Math190
Path: blob/main/course-assets/latex-examples/_minted-latex-template/CF28C34B6B9572E98C392999D0F53D52852B5456C4A0677C953D64E2CDC6B4B6.pygtex
919 views
\begin{Verbatim}[commandchars=\\\{\}]
    \PYG{k}{def} \PYG{n+nf}{square}\PYG{p}{(}\PYG{n}{x}\PYG{p}{):}
    \PYG{k}{return} \PYG{n}{x}\PYG{o}{*}\PYG{n}{x}

    \PYG{n}{result1}\PYG{o}{=}\PYG{n+nb}{list}\PYG{p}{(}\PYG{n+nb}{map}\PYG{p}{(}\PYG{n}{square}\PYG{p}{,[}\PYG{l+m+mi}{1}\PYG{p}{,}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}\PYG{p}{]))}
    \PYG{n}{result2}\PYG{o}{=}\PYG{n+nb}{list}\PYG{p}{(}\PYG{n+nb}{map}\PYG{p}{(}\PYG{n}{square}\PYG{p}{,[}\PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{4}\PYG{p}{,}\PYG{l+m+mi}{6}\PYG{p}{]))}
    \PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{result1}\PYG{p}{)}
    \PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{result2}\PYG{p}{)}
\end{Verbatim}