\documentclass[a4paper,11pt]{article}
\usepackage[polish]{babel}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage[scaled=0.85]{beramono}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{tcolorbox}
\usepackage{ulem}
\usepackage{geometry}
\lstloadlanguages{Python}
\tcbuselibrary{listings}

\geometry{width=126mm}

\lstset{literate=
  {ą}{{\k{a}}}{1} {ć}{{\'c}}{1} {ę}{{\k{e}}}{1} 
  {ó}{{\'o}}{1}   {ń}{{\'n}}{1} {ł}{{\l{}}}{1} 
  {ś}{{\'s}}{1}   {ź}{{\'z}}{1} {ż}{{\.z}}{1} 
  {Ą}{{\k{A}}}{1} {Ć}{{\'C}}{1} {Ę}{{\k{E}}}{1} 
  {Ó}{{\'O}}{1}   {Ń}{{\'N}}{1} {Ł}{{\L{}}}{1} 
  {Ś}{{\'S}}{1}   {Ź}{{\'Z}}{1} {Ż}{{\.Z}}{1},
}

\begin{document}

\begin{tcblisting}{colback=gray!10, colframe=gray, listing only,
title=Funkcja disjoint, fonttitle=\bfseries,
listing options={language=Python, basicstyle=\ttfamily\small, 
emph={disjoint}, emphstyle=\uline, emph={[2]True,False}, 
emphstyle={[2]\dashuline}}}
def disjoint(a,b):
    for i in a:         # przeglądamy wszystkie elementy listy a
        if i in b:      # sprawdzamy, czy należą do listy b
            return False
    return True
\end{tcblisting}

\end{document}