<div><h1id="comprehensivepythoncheatsheet">Comprehensive Python Cheatsheet</h1><pclass="banner"><sup><ahref="https://raw.githubusercontent.com/gto76/python-cheatsheet/main/README.md">Download text file</a>, <ahref="https://github.com/gto76/python-cheatsheet">Fork me on GitHub</a>, <ahref="https://github.com/gto76/python-cheatsheet/wiki/Frequently-Asked-Questions">Check out FAQ</a> or <ahref="index.html?theme=dark3">Switch to dark theme</a>.
<div><h1id="comprehensivepythoncheatsheet">Comprehensive Python Cheatsheet</h1><pclass="banner"><sup><ahref="https://raw.githubusercontent.com/gto76/python-cheatsheet/main/README.md">Download text file</a>, <ahref="https://github.com/gto76/python-cheatsheet">Fork me on GitHub</a>, <ahref="https://github.com/gto76/python-cheatsheet/wiki/Frequently-Asked-Questions">Check out FAQ</a> or <ahref="index.html?theme=dark3">Switch to dark theme</a>.
<div><h2id="function"><ahref="#function"name="function">#</a>Function</h2><p><strong>Independent block of code that returns a value when called.</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-function"><spanclass="hljs-keyword">def</span><<spanclass="hljs-title">func_name</span>><spanclass="hljs-params">(<nondefault_args>)</span>:</span> ... <spanclass="hljs-comment"># E.g. `def func(x, y): ...`.</span>