Skip to content

Commit af8ccc7

Browse files
black-nb
1 parent bf58e62 commit af8ccc7

25 files changed

+141
-57
lines changed

docs/_sources/prodigiouspython/Chapter_1/4_Datatypes.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@
101101
"if value is None:\n",
102102
" print(f\"There is no environment variable named {new_environment_variable_name}\")\n",
103103
"else:\n",
104-
" print(f\"The value assigned for the environment variable named {new_environment_variable_name} is {value}\")"
104+
" print(\n",
105+
" f\"The value assigned for the environment variable named {new_environment_variable_name} is {value}\"\n",
106+
" )"
105107
]
106108
},
107109
{
@@ -397,7 +399,9 @@
397399
"# of the existing objects.\n",
398400
"\n",
399401
"# We can get the values by index.\n",
400-
"print(f\"{language_initial_release_year[0]} is released in {language_initial_release_year[1]}\")"
402+
"print(\n",
403+
" f\"{language_initial_release_year[0]} is released in {language_initial_release_year[1]}\"\n",
404+
")"
401405
]
402406
},
403407
{

docs/_sources/prodigiouspython/Chapter_1/5_Collection_Types.ipynb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,9 @@
350350
"# When index argument is passed, it would remove and return the element at that index.\n",
351351
"# raises IndexError when no object is present at the given Index.\n",
352352
"try:\n",
353-
" last_element = my_list.pop() # can be passed index argument value, if required to pop at a specific index.\n",
353+
" last_element = (\n",
354+
" my_list.pop()\n",
355+
" ) # can be passed index argument value, if required to pop at a specific index.\n",
354356
" print(last_element)\n",
355357
"except IndexError as exc:\n",
356358
" print(f\"Caught IndexError: {exc}\")"
@@ -420,7 +422,9 @@
420422
" anime.remove(\"Tokyo Ghoul\")\n",
421423
" print(anime)\n",
422424
"except KeyError as exc:\n",
423-
" print(f\"Caught KeyError as there's given anime series present in the anime set: {exc}\")"
425+
" print(\n",
426+
" f\"Caught KeyError as there's given anime series present in the anime set: {exc}\"\n",
427+
" )"
424428
]
425429
},
426430
{
@@ -472,7 +476,9 @@
472476
"try:\n",
473477
" print(anime_protagonist[\"Dragon Ball\"])\n",
474478
"except KeyError as exc:\n",
475-
" print(f\"👻 Ouch, KeyError has been raised as no given key is found in the dictionary: {exc}\")"
479+
" print(\n",
480+
" f\"👻 Ouch, KeyError has been raised as no given key is found in the dictionary: {exc}\"\n",
481+
" )"
476482
]
477483
},
478484
{

docs/_sources/prodigiouspython/Chapter_5/1_Mathematical_Operators.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,9 @@
593593
"source": [
594594
"print(integer_a // integer_b)\n",
595595
"print(float_a // float_b)\n",
596-
"print(5 // 2) # When divided result should be 2.5, but for floor division the result would be just 2."
596+
"print(\n",
597+
" 5 // 2\n",
598+
") # When divided result should be 2.5, but for floor division the result would be just 2."
597599
]
598600
},
599601
{

docs/_sources/prodigiouspython/Chapter_6/1_Conditionals.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@
215215
"outputs": [],
216216
"source": [
217217
"if 3 > 4:\n",
218-
" print(\"3 is greater than 4! 😅\") # This wouldn't get executed as 3 is not greater than 4.\n",
218+
" print(\n",
219+
" \"3 is greater than 4! 😅\"\n",
220+
" ) # This wouldn't get executed as 3 is not greater than 4.\n",
219221
"elif 4 > 3:\n",
220222
" print(\"4 is greater than 3! 😊\")"
221223
]
@@ -424,7 +426,9 @@
424426
" func()\n",
425427
" func = my_dict[\"Python\"]\n",
426428
" func()\n",
427-
" func = my_dict[\"Random Key\"] # We don't have a key called \"Random Key\". Hence, it raises KeyError.\n",
429+
" func = my_dict[\n",
430+
" \"Random Key\"\n",
431+
" ] # We don't have a key called \"Random Key\". Hence, it raises KeyError.\n",
428432
"except KeyError as exc:\n",
429433
" print(f\"Ouch, there is no switch for the value: {exc}\")"
430434
]

docs/_sources/prodigiouspython/Chapter_8/1_Classes.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@
142142
" pass\n",
143143
"\n",
144144
"\n",
145-
"class IAmASimpleClass(object): # We can explicitly inherit object, although not required.\n",
145+
"class IAmASimpleClass(\n",
146+
" object\n",
147+
"): # We can explicitly inherit object, although not required.\n",
146148
" pass"
147149
]
148150
},
@@ -188,7 +190,9 @@
188190
"outputs": [],
189191
"source": [
190192
"class SuperHero:\n",
191-
" def __init__(self, name, power_level, special_power): # One of the special/magic/dunder method.\n",
193+
" def __init__(\n",
194+
" self, name, power_level, special_power\n",
195+
" ): # One of the special/magic/dunder method.\n",
192196
" self.name = name # Instance attributes.\n",
193197
" self.power_level = power_level\n",
194198
" self.special_power = special_power\n",

docs/_sources/prodigiouspython/Chapter_8/2_Class_Attributes.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,9 @@
521521
"\n",
522522
" def __init__(self):\n",
523523
" Counter.no_of_objects_created += 1\n",
524-
" print(f\"Number of objects created of Counter class are: {Counter.no_of_objects_created}\")"
524+
" print(\n",
525+
" f\"Number of objects created of Counter class are: {Counter.no_of_objects_created}\"\n",
526+
" )"
525527
]
526528
},
527529
{
@@ -581,7 +583,9 @@
581583
"\n",
582584
" def __init__(self):\n",
583585
" self.no_of_objects_created += 1\n",
584-
" print(f\"Number of objects created of Counter class are: {self.no_of_objects_created}\")"
586+
" print(\n",
587+
" f\"Number of objects created of Counter class are: {self.no_of_objects_created}\"\n",
588+
" )"
585589
]
586590
},
587591
{

docs/_sources/prodigiouspython/Chapter_8/3_Class_Static_Methods.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,15 @@
7171
" Anime.list_of_animes.append(name)\n",
7272
"\n",
7373
" def introduce(self): # Instance Method.\n",
74-
" print(f\"Hey weebs! We are {self.name}. We have awesome characters: {self.characters} 🔥\")\n",
74+
" print(\n",
75+
" f\"Hey weebs! We are {self.name}. We have awesome characters: {self.characters} 🔥\"\n",
76+
" )\n",
7577
"\n",
7678
" @classmethod\n",
7779
" def show_list_and_count_of_animes(cls): # Class Method.\n",
78-
" print(f\"Animes listed are: {cls.list_of_animes} which sums up to {len(cls.list_of_animes)}\")\n",
80+
" print(\n",
81+
" f\"Animes listed are: {cls.list_of_animes} which sums up to {len(cls.list_of_animes)}\"\n",
82+
" )\n",
7983
"\n",
8084
" @staticmethod\n",
8185
" def temp():\n",

docs/prodigiouspython/Chapter_1/10_String_representations_of_objects.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ <h1><span class="section-number">10. </span>String representations of objects: s
501501
</div>
502502
</div>
503503
<div class="cell_output docutils container">
504-
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The repr of now is: datetime.datetime(2023, 9, 4, 15, 9, 3, 655082)
505-
The str of now is: 2023-09-04 15:09:03.655082
504+
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The repr of now is: datetime.datetime(2023, 9, 5, 20, 5, 22, 200371)
505+
The str of now is: 2023-09-05 20:05:22.200371
506506
</pre></div>
507507
</div>
508508
</div>
@@ -521,8 +521,8 @@ <h1><span class="section-number">10. </span>String representations of objects: s
521521
</div>
522522
</div>
523523
<div class="cell_output docutils container">
524-
<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 0x7f8eee7553d0&gt;
525-
The str of language_obj is: &lt;__main__.ProgrammingLanguage object at 0x7f8eee7553d0&gt;
524+
<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 0x7f66345afd50&gt;
525+
The str of language_obj is: &lt;__main__.ProgrammingLanguage object at 0x7f66345afd50&gt;
526526
</pre></div>
527527
</div>
528528
</div>
@@ -552,7 +552,7 @@ <h1><span class="section-number">10. </span>String representations of objects: s
552552
</div>
553553
</div>
554554
<div class="cell_output docutils container">
555-
<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 0x7f8eee754250
555+
<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 0x7f66345ca690
556556
The str of human_obj is: I am IronMan of age 48
557557
</pre></div>
558558
</div>

docs/prodigiouspython/Chapter_1/4_Datatypes.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,9 @@ <h3><span class="section-number">4.1.1. </span><em>Example of None usage</em>:<a
574574
<span class="k">if</span> <span class="n">value</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
575575
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;There is no environment variable named </span><span class="si">{</span><span class="n">new_environment_variable_name</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
576576
<span class="k">else</span><span class="p">:</span>
577-
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;The value assigned for the environment variable named </span><span class="si">{</span><span class="n">new_environment_variable_name</span><span class="si">}</span><span class="s2"> is </span><span class="si">{</span><span class="n">value</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
577+
<span class="nb">print</span><span class="p">(</span>
578+
<span class="sa">f</span><span class="s2">&quot;The value assigned for the environment variable named </span><span class="si">{</span><span class="n">new_environment_variable_name</span><span class="si">}</span><span class="s2"> is </span><span class="si">{</span><span class="n">value</span><span class="si">}</span><span class="s2">&quot;</span>
579+
<span class="p">)</span>
578580
</pre></div>
579581
</div>
580582
</div>
@@ -756,7 +758,9 @@ <h2><span class="section-number">4.8. </span><strong>tuple</strong><a class="hea
756758
<span class="c1"># of the existing objects.</span>
757759

758760
<span class="c1"># We can get the values by index.</span>
759-
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">language_initial_release_year</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="si">}</span><span class="s2"> is released in </span><span class="si">{</span><span class="n">language_initial_release_year</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
761+
<span class="nb">print</span><span class="p">(</span>
762+
<span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">language_initial_release_year</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="si">}</span><span class="s2"> is released in </span><span class="si">{</span><span class="n">language_initial_release_year</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="si">}</span><span class="s2">&quot;</span>
763+
<span class="p">)</span>
760764
</pre></div>
761765
</div>
762766
</div>
@@ -815,7 +819,7 @@ <h2><span class="section-number">4.10. </span><strong>set</strong><a class="head
815819
</div>
816820
</div>
817821
<div class="cell_output docutils container">
818-
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;Golang&#39;, 3, 4, &#39;Python&#39;, 6, 10}
822+
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;Python&#39;, 3, 4, 6, &#39;Golang&#39;, 10}
819823
</pre></div>
820824
</div>
821825
</div>

docs/prodigiouspython/Chapter_1/5_Collection_Types.html

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,9 @@ <h3><span class="section-number">5.2.1. </span>We have a few methods of list tha
745745
<span class="c1"># When index argument is passed, it would remove and return the element at that index.</span>
746746
<span class="c1"># raises IndexError when no object is present at the given Index.</span>
747747
<span class="k">try</span><span class="p">:</span>
748-
<span class="n">last_element</span> <span class="o">=</span> <span class="n">my_list</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span> <span class="c1"># can be passed index argument value, if required to pop at a specific index.</span>
748+
<span class="n">last_element</span> <span class="o">=</span> <span class="p">(</span>
749+
<span class="n">my_list</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span>
750+
<span class="p">)</span> <span class="c1"># can be passed index argument value, if required to pop at a specific index.</span>
749751
<span class="nb">print</span><span class="p">(</span><span class="n">last_element</span><span class="p">)</span>
750752
<span class="k">except</span> <span class="ne">IndexError</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
751753
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Caught IndexError: </span><span class="si">{</span><span class="n">exc</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
@@ -773,7 +775,7 @@ <h2><span class="section-number">5.3. </span>Set<a class="headerlink" href="#set
773775
</div>
774776
</div>
775777
<div class="cell_output docutils container">
776-
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;Full Metal Alchemist&#39;, &#39;One Piece&#39;, &#39;Death Note&#39;, &#39;Naruto&#39;, &#39;Dragon ball&#39;}
778+
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;One Piece&#39;, &#39;Naruto&#39;, &#39;Death Note&#39;, &#39;Dragon ball&#39;, &#39;Full Metal Alchemist&#39;}
777779
</pre></div>
778780
</div>
779781
</div>
@@ -787,7 +789,7 @@ <h2><span class="section-number">5.3. </span>Set<a class="headerlink" href="#set
787789
</div>
788790
</div>
789791
<div class="cell_output docutils container">
790-
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;Full Metal Alchemist&#39;, &#39;One Piece&#39;, &#39;Death Note&#39;, &#39;Naruto&#39;, &#39;Dragon ball&#39;, &#39;Tokyo Ghoul&#39;}
792+
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;One Piece&#39;, &#39;Naruto&#39;, &#39;Death Note&#39;, &#39;Dragon ball&#39;, &#39;Full Metal Alchemist&#39;, &#39;Tokyo Ghoul&#39;}
791793
</pre></div>
792794
</div>
793795
</div>
@@ -800,12 +802,14 @@ <h2><span class="section-number">5.3. </span>Set<a class="headerlink" href="#set
800802
<span class="n">anime</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="s2">&quot;Tokyo Ghoul&quot;</span><span class="p">)</span>
801803
<span class="nb">print</span><span class="p">(</span><span class="n">anime</span><span class="p">)</span>
802804
<span class="k">except</span> <span class="ne">KeyError</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
803-
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Caught KeyError as there&#39;s given anime series present in the anime set: </span><span class="si">{</span><span class="n">exc</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
805+
<span class="nb">print</span><span class="p">(</span>
806+
<span class="sa">f</span><span class="s2">&quot;Caught KeyError as there&#39;s given anime series present in the anime set: </span><span class="si">{</span><span class="n">exc</span><span class="si">}</span><span class="s2">&quot;</span>
807+
<span class="p">)</span>
804808
</pre></div>
805809
</div>
806810
</div>
807811
<div class="cell_output docutils container">
808-
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;Full Metal Alchemist&#39;, &#39;One Piece&#39;, &#39;Death Note&#39;, &#39;Naruto&#39;, &#39;Dragon ball&#39;}
812+
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;One Piece&#39;, &#39;Naruto&#39;, &#39;Death Note&#39;, &#39;Dragon ball&#39;, &#39;Full Metal Alchemist&#39;}
809813
</pre></div>
810814
</div>
811815
</div>
@@ -841,7 +845,9 @@ <h2><span class="section-number">5.4. </span>Dictionary<a class="headerlink" hre
841845
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="k">try</span><span class="p">:</span>
842846
<span class="nb">print</span><span class="p">(</span><span class="n">anime_protagonist</span><span class="p">[</span><span class="s2">&quot;Dragon Ball&quot;</span><span class="p">])</span>
843847
<span class="k">except</span> <span class="ne">KeyError</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
844-
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;👻 Ouch, KeyError has been raised as no given key is found in the dictionary: </span><span class="si">{</span><span class="n">exc</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
848+
<span class="nb">print</span><span class="p">(</span>
849+
<span class="sa">f</span><span class="s2">&quot;👻 Ouch, KeyError has been raised as no given key is found in the dictionary: </span><span class="si">{</span><span class="n">exc</span><span class="si">}</span><span class="s2">&quot;</span>
850+
<span class="p">)</span>
845851
</pre></div>
846852
</div>
847853
</div>

0 commit comments

Comments
 (0)