Skip to content

Commit 9b12047

Browse files
committed
Add pass statement
1 parent f35328f commit 9b12047

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed

notebooks/beginner/functions.ipynb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,27 @@
207207
"\n",
208208
"print(help(calculate_sum))"
209209
]
210+
},
211+
{
212+
"cell_type": "markdown",
213+
"metadata": {},
214+
"source": [
215+
"### [`pass`](https://docs.python.org/3/reference/simple_stmts.html#the-pass-statement) statement\n",
216+
"`pass` is a statement which does nothing when it's executed. It can be used e.g. as placeholder to make the code syntatically correct while sketching the functions and/or classes of your application. For example, the following is valid Python. "
217+
]
218+
},
219+
{
220+
"cell_type": "code",
221+
"execution_count": null,
222+
"metadata": {},
223+
"outputs": [],
224+
"source": [
225+
"def my_function(some_argument):\n",
226+
" pass\n",
227+
"\n",
228+
"def my_other_function():\n",
229+
" pass"
230+
]
210231
}
211232
],
212233
"metadata": {

notebooks/beginner/html/functions.html

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11830,7 +11830,7 @@ <h1 id="Functions">Functions<a class="anchor-link" href="#Functions">&#182;</a><
1183011830

1183111831

1183211832
<div class="output_subarea output_stream output_stdout output_text">
11833-
<pre>type: &lt;function my_first_function at 0x1069bb6a8&gt;
11833+
<pre>type: &lt;function my_first_function at 0x1060bd6a8&gt;
1183411834
Hello world!
1183511835
</pre>
1183611836
</div>
@@ -12015,8 +12015,8 @@ <h3 id="Default-arguments">Default arguments<a class="anchor-link" href="#Defaul
1201512015

1201612016

1201712017
<div class="output_subarea output_stream output_stdout output_text">
12018-
<pre>{&#39;age&#39;: 82, &#39;name&#39;: &#39;John Doe&#39;, &#39;salary&#39;: 300}
12019-
{&#39;age&#39;: 22, &#39;name&#39;: &#39;Lisa Doe&#39;, &#39;salary&#39;: 10000, &#39;job&#39;: &#39;hacker&#39;}
12018+
<pre>{&#39;name&#39;: &#39;John Doe&#39;, &#39;salary&#39;: 300, &#39;age&#39;: 82}
12019+
{&#39;name&#39;: &#39;Lisa Doe&#39;, &#39;job&#39;: &#39;hacker&#39;, &#39;salary&#39;: 10000, &#39;age&#39;: 22}
1202012020
</pre>
1202112021
</div>
1202212022
</div>
@@ -12237,6 +12237,32 @@ <h3 id="Docstrings">Docstrings<a class="anchor-link" href="#Docstrings">&#182;</
1223712237
</div>
1223812238
</div>
1223912239

12240+
</div>
12241+
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
12242+
</div>
12243+
<div class="inner_cell">
12244+
<div class="text_cell_render border-box-sizing rendered_html">
12245+
<h3 id="pass-statement"><a href="https://docs.python.org/3/reference/simple_stmts.html#the-pass-statement"><code>pass</code></a> statement<a class="anchor-link" href="#pass-statement">&#182;</a></h3><p><code>pass</code> is a statement which does nothing when it's executed. It can be used e.g. as placeholder to make the code syntatically correct while sketching the functions and/or classes of your application. For example, the following is valid Python.</p>
12246+
12247+
</div>
12248+
</div>
12249+
</div>
12250+
<div class="cell border-box-sizing code_cell rendered">
12251+
<div class="input">
12252+
<div class="prompt input_prompt">In&nbsp;[10]:</div>
12253+
<div class="inner_cell">
12254+
<div class="input_area">
12255+
<div class=" highlight hl-ipython3"><pre><span></span><span class="k">def</span> <span class="nf">my_function</span><span class="p">(</span><span class="n">some_argument</span><span class="p">):</span>
12256+
<span class="k">pass</span>
12257+
12258+
<span class="k">def</span> <span class="nf">my_other_function</span><span class="p">():</span>
12259+
<span class="k">pass</span>
12260+
</pre></div>
12261+
12262+
</div>
12263+
</div>
12264+
</div>
12265+
1224012266
</div>
1224112267
</div>
1224212268
</div>

0 commit comments

Comments
 (0)