\usepackage{listings} %for aa legge til python-kode
\usepackage{color} %for fanci python kode

%definerer farger ogsaann
\definecolor{commentgray}{rgb}{0.3, 0.3, 0.3}
\definecolor{codegray}{rgb}{0, 0, 0}
\definecolor{stringgreen}{rgb}{0, 0.6, 0}
\definecolor{backcolour}{rgb}{0.95, 0.95, 0.95}

\lstdefinestyle{mystyle}{
backgroundcolor=\color{backcolour},
commentstyle=\color{commentgray},
keywordstyle=\color{blue},
numberstyle=\tiny\color{codegray},
stringstyle=\color{stringgreen},
basicstyle=\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2
}
\lstset{style=mystyle}