Skip to content

Commit 5f61114

Browse files
updated docs
1 parent 441401f commit 5f61114

17 files changed

+648
-26
lines changed

docs/_sources/prodigiouspython/Chapter_1/1_Getting_Started_With_Python_Language.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"We would be using Python >= 3.9 in this [Repository](https://github.com/ProdigiousPython/prodigiouspython) as of now 🙂\n",
1919
"\n",
2020
"1. [Download Python](https://www.python.org/)\n",
21-
"2. Pull the docker image [naveen8/prodigiouspython](https://hub.docker.com/r/naveen8/ProdigiousPython) or build a Docker image by using the Dockerfile present in our [Repository](https://github.com/ProdigiousPython/ProdigiousPython) and run the container out of it which comes bundled with everything to run the code present in our repository 🚀."
21+
"2. Pull the docker image [naveen8/prodigiouspython](https://hub.docker.com/r/naveen8/prodigiouspython) or build a Docker image by using the Dockerfile present in our [Repository](https://github.com/ProdigiousPython/ProdigiousPython) and run the container out of it which comes bundled with everything to run the code present in our repository 🚀."
2222
]
2323
},
2424
{
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "945f8333-09ad-4b4e-b03e-cbe1cbaced57",
6+
"metadata": {},
7+
"source": [
8+
"# ClassMethod and StaticMethod"
9+
]
10+
},
11+
{
12+
"cell_type": "markdown",
13+
"id": "9c056145-cda0-4ef8-8b4d-41fd8bb93ba0",
14+
"metadata": {},
15+
"source": [
16+
"## ClassMethod"
17+
]
18+
},
19+
{
20+
"cell_type": "markdown",
21+
"id": "38770d21-937b-4873-bcce-a93daeee1827",
22+
"metadata": {},
23+
"source": [
24+
"## StaticMethod"
25+
]
26+
},
27+
{
28+
"cell_type": "markdown",
29+
"id": "a3fdce0c-78e0-439c-93ea-610356bfc172",
30+
"metadata": {},
31+
"source": [
32+
"StaticMethods are simple regular functions but are within the namespace/scope of the class. "
33+
]
34+
},
35+
{
36+
"cell_type": "markdown",
37+
"id": "bb4f57d7-b874-427f-a976-2b32375ee4bd",
38+
"metadata": {},
39+
"source": [
40+
"The Static methods are created using the decorator `staticmethod`. "
41+
]
42+
},
43+
{
44+
"cell_type": "code",
45+
"execution_count": null,
46+
"id": "e785758b-8ef9-4920-9fdf-5d0f0d9d8976",
47+
"metadata": {},
48+
"outputs": [],
49+
"source": [
50+
"class StaticMethodExample:\n",
51+
" @staticmethod\n",
52+
" def do_something():\n",
53+
" "
54+
]
55+
}
56+
],
57+
"metadata": {
58+
"kernelspec": {
59+
"display_name": "Python 3 (ipykernel)",
60+
"language": "python",
61+
"name": "python3"
62+
},
63+
"language_info": {
64+
"codemirror_mode": {
65+
"name": "ipython",
66+
"version": 3
67+
},
68+
"file_extension": ".py",
69+
"mimetype": "text/x-python",
70+
"name": "python",
71+
"nbconvert_exporter": "python",
72+
"pygments_lexer": "ipython3",
73+
"version": "3.9.7"
74+
}
75+
},
76+
"nbformat": 4,
77+
"nbformat_minor": 5
78+
}

docs/objects.inv

29 Bytes
Binary file not shown.

docs/prodigiouspython/Chapter_1/10_String_representations_of_objects.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,8 @@ <h1><span class="section-number">10. </span>String representations of objects: s
445445
</div>
446446
</div>
447447
<div class="cell_output docutils container">
448-
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The repr of now is: datetime.datetime(2022, 1, 7, 18, 49, 47, 661400)
449-
The str of now is: 2022-01-07 18:49:47.661400
448+
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The repr of now is: datetime.datetime(2022, 1, 18, 7, 35, 16, 224748)
449+
The str of now is: 2022-01-18 07:35:16.224748
450450
</pre></div>
451451
</div>
452452
</div>
@@ -465,8 +465,8 @@ <h1><span class="section-number">10. </span>String representations of objects: s
465465
</div>
466466
</div>
467467
<div class="cell_output docutils container">
468-
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The repr of language_obj is: &lt;__main__.ProgrammingLanguage object at 0x7ff50414e850&gt;
469-
The str of language_obj is: &lt;__main__.ProgrammingLanguage object at 0x7ff50414e850&gt;
468+
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The repr of language_obj is: &lt;__main__.ProgrammingLanguage object at 0x7fad20742190&gt;
469+
The str of language_obj is: &lt;__main__.ProgrammingLanguage object at 0x7fad20742190&gt;
470470
</pre></div>
471471
</div>
472472
</div>
@@ -496,7 +496,7 @@ <h1><span class="section-number">10. </span>String representations of objects: s
496496
</div>
497497
</div>
498498
<div class="cell_output docutils container">
499-
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The repr of human_obj is: Human(name=IronMan, age=48) object at 0x7ff5040f9af0
499+
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The repr of human_obj is: Human(name=IronMan, age=48) object at 0x7fad20742ee0
500500
The str of human_obj is: I am IronMan of age 48
501501
</pre></div>
502502
</div>

docs/prodigiouspython/Chapter_1/1_Getting_Started_With_Python_Language.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ <h1><span class="section-number">1. </span>Getting Started with Python 🐍<a cl
430430
We would be using Python &gt;= 3.9 in this <a class="reference external" href="https://github.com/ProdigiousPython/prodigiouspython">Repository</a> as of now 🙂</p>
431431
<ol class="simple">
432432
<li><p><a class="reference external" href="https://www.python.org/">Download Python</a></p></li>
433-
<li><p>Pull the docker image <a class="reference external" href="https://hub.docker.com/r/naveen8/ProdigiousPython">naveen8/prodigiouspython</a> or build a Docker image by using the Dockerfile present in our <a class="reference external" href="https://github.com/ProdigiousPython/ProdigiousPython">Repository</a> and run the container out of it which comes bundled with everything to run the code present in our repository 🚀.</p></li>
433+
<li><p>Pull the docker image <a class="reference external" href="https://hub.docker.com/r/naveen8/prodigiouspython">naveen8/prodigiouspython</a> or build a Docker image by using the Dockerfile present in our <a class="reference external" href="https://github.com/ProdigiousPython/ProdigiousPython">Repository</a> and run the container out of it which comes bundled with everything to run the code present in our repository 🚀.</p></li>
434434
</ol>
435435
<p>Lets check the version of Python we are using.
436436
We have 2 ways to know this.</p>

docs/prodigiouspython/Chapter_1/4_Datatypes.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ <h2><span class="section-number">4.10. </span><strong>set</strong><a class="head
947947
</div>
948948
</div>
949949
<div class="cell_output docutils container">
950-
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{3, 4, &#39;Golang&#39;, 6, &#39;Python&#39;, 10}
950+
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{3, 4, 6, &#39;Golang&#39;, &#39;Python&#39;, 10}
951951
</pre></div>
952952
</div>
953953
</div>

docs/prodigiouspython/Chapter_1/5_Collection_Types.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ <h2><span class="section-number">5.3. </span>Set<a class="headerlink" href="#set
773773
</div>
774774
</div>
775775
<div class="cell_output docutils container">
776-
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;Dragon ball&#39;, &#39;Full Metal Alchemist&#39;, &#39;One Piece&#39;, &#39;Naruto&#39;, &#39;Death Note&#39;}
776+
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;Dragon ball&#39;, &#39;Naruto&#39;, &#39;Death Note&#39;, &#39;Full Metal Alchemist&#39;, &#39;One Piece&#39;}
777777
</pre></div>
778778
</div>
779779
</div>
@@ -787,7 +787,7 @@ <h2><span class="section-number">5.3. </span>Set<a class="headerlink" href="#set
787787
</div>
788788
</div>
789789
<div class="cell_output docutils container">
790-
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;Dragon ball&#39;, &#39;Tokyo Ghoul&#39;, &#39;Full Metal Alchemist&#39;, &#39;One Piece&#39;, &#39;Naruto&#39;, &#39;Death Note&#39;}
790+
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;Dragon ball&#39;, &#39;Naruto&#39;, &#39;Death Note&#39;, &#39;Full Metal Alchemist&#39;, &#39;Tokyo Ghoul&#39;, &#39;One Piece&#39;}
791791
</pre></div>
792792
</div>
793793
</div>
@@ -807,7 +807,7 @@ <h2><span class="section-number">5.3. </span>Set<a class="headerlink" href="#set
807807
</div>
808808
</div>
809809
<div class="cell_output docutils container">
810-
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;Dragon ball&#39;, &#39;Full Metal Alchemist&#39;, &#39;One Piece&#39;, &#39;Naruto&#39;, &#39;Death Note&#39;}
810+
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;Dragon ball&#39;, &#39;Naruto&#39;, &#39;Death Note&#39;, &#39;Full Metal Alchemist&#39;, &#39;One Piece&#39;}
811811
</pre></div>
812812
</div>
813813
</div>

docs/prodigiouspython/Chapter_4/1_Functions.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ <h3><span class="section-number">15.2.3. </span>Returning a function<a class="he
657657
</div>
658658
</div>
659659
<div class="cell_output docutils container">
660-
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>obj is &lt;function first_function at 0x7f4ab84853a0&gt;
660+
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>obj is &lt;function first_function at 0x7ff9d024a4c0&gt;
661661
obj name is first_function
662662
Is obj callable? True
663663
</pre></div>
@@ -679,7 +679,7 @@ <h3><span class="section-number">15.2.4. </span>Deletion of function object<a cl
679679
<div class="cell_output docutils container">
680680
<div class="output traceback highlight-ipythontb notranslate"><div class="highlight"><pre><span></span><span class="gt">---------------------------------------------------------------------------</span>
681681
<span class="ne">NameError</span><span class="g g-Whitespace"> </span>Traceback (most recent call last)
682-
<span class="o">/</span><span class="n">tmp</span><span class="o">/</span><span class="n">ipykernel_4477</span><span class="o">/</span><span class="mf">186491708.</span><span class="n">py</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
682+
<span class="n">Input</span> <span class="n">In</span> <span class="p">[</span><span class="mi">12</span><span class="p">],</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
683683
<span class="g g-Whitespace"> </span><span class="mi">1</span> <span class="k">del</span> <span class="n">first_function</span>
684684
<span class="ne">----&gt; </span><span class="mi">2</span> <span class="n">first_function</span><span class="p">()</span>
685685

docs/prodigiouspython/Chapter_4/2_Positional_Arguments.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ <h1><span class="section-number">16. </span>Positional Arguments<a class="header
483483
<div class="cell_output docutils container">
484484
<div class="output traceback highlight-ipythontb notranslate"><div class="highlight"><pre><span></span><span class="gt">---------------------------------------------------------------------------</span>
485485
<span class="ne">TypeError</span><span class="g g-Whitespace"> </span>Traceback (most recent call last)
486-
<span class="o">/</span><span class="n">tmp</span><span class="o">/</span><span class="n">ipykernel_4497</span><span class="o">/</span><span class="mf">746715703.</span><span class="n">py</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
486+
<span class="n">Input</span> <span class="n">In</span> <span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
487487
<span class="ne">----&gt; </span><span class="mi">1</span> <span class="n">add</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
488488

489489
<span class="ne">TypeError</span>: add() missing 1 required positional argument: &#39;operand_2&#39;
@@ -552,7 +552,7 @@ <h2><span class="section-number">16.1. </span>Position only arguments<a class="h
552552
<div class="cell_output docutils container">
553553
<div class="output traceback highlight-ipythontb notranslate"><div class="highlight"><pre><span></span><span class="gt">---------------------------------------------------------------------------</span>
554554
<span class="ne">TypeError</span><span class="g g-Whitespace"> </span>Traceback (most recent call last)
555-
<span class="o">/</span><span class="n">tmp</span><span class="o">/</span><span class="n">ipykernel_4497</span><span class="o">/</span><span class="mf">1994685720.</span><span class="n">py</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
555+
<span class="n">Input</span> <span class="n">In</span> <span class="p">[</span><span class="mi">8</span><span class="p">],</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
556556
<span class="ne">----&gt; </span><span class="mi">1</span> <span class="n">greet</span><span class="p">(</span><span class="n">greet_word</span><span class="o">=</span><span class="s2">&quot;Hello&quot;</span><span class="p">,</span> <span class="n">name_of_the_user</span><span class="o">=</span><span class="s2">&quot;Pythonist&quot;</span><span class="p">)</span>
557557

558558
<span class="ne">TypeError</span>: greet() got some positional-only arguments passed as keyword arguments: &#39;greet_word&#39;

docs/prodigiouspython/Chapter_4/4_Keyword_only_arguments.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ <h1><span class="section-number">18. </span>Keyword-only arguments<a class="head
451451
<div class="cell_output docutils container">
452452
<div class="output traceback highlight-ipythontb notranslate"><div class="highlight"><pre><span></span><span class="gt">---------------------------------------------------------------------------</span>
453453
<span class="ne">TypeError</span><span class="g g-Whitespace"> </span>Traceback (most recent call last)
454-
<span class="o">/</span><span class="n">tmp</span><span class="o">/</span><span class="n">ipykernel_4534</span><span class="o">/</span><span class="mf">496164863.</span><span class="n">py</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
454+
<span class="n">Input</span> <span class="n">In</span> <span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
455455
<span class="ne">----&gt; </span><span class="mi">1</span> <span class="n">greet</span><span class="p">(</span><span class="s2">&quot;Hello&quot;</span><span class="p">,</span> <span class="s2">&quot;Pythonist ♥️&quot;</span><span class="p">)</span>
456456

457457
<span class="ne">TypeError</span>: greet() takes 0 positional arguments but 2 were given

0 commit comments

Comments
 (0)