<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-960876793746149434</atom:id><lastBuildDate>Thu, 26 Sep 2024 02:51:36 +0000</lastBuildDate><category>pyquick</category><category>Python 3</category><category>Google PyQuick</category><category>Nick Parlante</category><category>Python</category><category>Google Python tutorials</category><category>HTTP Exceptions</category><category>OS</category><category>OS commands</category><category>Python 3 credit card class source code</category><category>Python I/O</category><category>Python Set Theory and Logic</category><category>Python file objects</category><category>Regular Expressions</category><category>URLs</category><category>Utilities</category><category>class</category><category>dictionaries</category><category>downloading Python</category><category>files</category><category>lists</category><category>object oriented programming (OOP) language</category><category>pickle</category><category>python file input</category><category>python file output</category><category>random module</category><category>reading first Python program</category><category>sorting</category><category>strings</category><category>tuples</category><category>writing first Python program</category><title>PYTHON 3</title><description></description><link>http://pythonelcric.blogspot.com/</link><managingEditor>noreply@blogger.com (Ron Tinnel)</managingEditor><generator>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-960876793746149434.post-7506339868480472320</guid><pubDate>Tue, 18 Dec 2012 00:21:00 +0000</pubDate><atom:updated>2013-03-03T13:27:31.531-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">pyquick</category><category domain="http://www.blogger.com/atom/ns#">Python 3</category><category domain="http://www.blogger.com/atom/ns#">random module</category><title>PYTHON 3 RANDOM MODULE</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;title&gt;PYTHON 3 RANDOM GENERATORS&lt;/title&gt;
&lt;br /&gt;
&lt;div class=&quot;g-plusone&quot; data-annotation=&quot;inline&quot; data-width=&quot;300&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://www.elcricottocircle.blogspot.com/&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt;&lt;/span&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: xx-small;&quot;&gt;REVISED: Sunday, March 3, 2013&lt;/span&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: 800;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; imageanchor=&quot;1&quot; style=&quot;font-weight: bold; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;Python 3 Random Module.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;I. &amp;nbsp;PYTHON 3 RANDOM MODULE INTRODUCTION&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;For non state sharing generators &lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;instantiate multiple &lt;span style=&quot;color: magenta;&quot;&gt;random&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;instances&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;random.randint(a, b)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Returns a random integer N such that a &amp;lt;= N &amp;lt;= b.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;random.choice(seq)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Returns a random element from the non-empty sequence &lt;span style=&quot;color: magenta;&quot;&gt;seq&lt;/span&gt;.&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;IndexError&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt; is raised i&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;f &lt;span style=&quot;color: magenta;&quot;&gt;seq&lt;/span&gt; is empty.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: magenta;&quot;&gt;random.shuffle(x)&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Shuffle the sequence &lt;span style=&quot;color: magenta;&quot;&gt;x = [1, 2, 3...]&lt;/span&gt; in place.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;II. &amp;nbsp;PYTHON 3 RANDOM MODULE EXAMPLE SOURCE CODE&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;from random import&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;shuffle&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;, choice, randint&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;def main():&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; # Example 1&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(&#39;EXAMPLE 1:\n&#39;,&#39;The Python code randint(-10,10) provides a random integer between 10 and -10; e.g.,&#39;,randint(-10,10),&#39;.\n&#39;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; # Example 2&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; pet = (&#39;dog&#39;, &#39;cat&#39;, &#39;turtle&#39;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(&#39;EXAMPLE 2:\n&#39;,&#39;Given the choice of pets is (\&#39;dog\&#39;, \&#39;cat\&#39;, \&#39;turtle\&#39;) choice(s) randomly picks a pet; for example,&#39;,choice(pet),&#39;.\n&#39;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; # Example 3&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; num = randint(1,10)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(&#39;EXAMPLE 3:\n&#39;,&#39;Given a random number between one and ten; e.g.,&#39;,num,&#39;.&#39;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; guess = int(input(&#39;Enter a number from one and ten and left mouse click OK:&#39;))&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(&#39;You try to determine the random number and pick&#39;,guess,&#39;.&#39;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; if num == guess:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&#39;Your number was right!\n&#39;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; else:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&#39;Your number was wrong!\n&#39;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; # Example 4&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(&#39;EXAMPLE 4:\n&#39;,&#39;The total number of the two dice you roll is&#39;,randint(1,6) + randint(1,6),&#39;.\n&#39;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; # Example 5&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(&#39;EXAMPLE 5:\n&#39;,&#39;You walk into a cave looking for gold.&#39;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; if randint(1,2) == 1:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&#39;You locate gold!&#39;,&#39;\n&#39;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; else:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&#39;You have fun but do not locate any gold.&#39;,&#39;\n&#39;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;# Example 6&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ,13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52]&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(&#39;EXAMPLE 6:\n&#39;,&#39;A deck of cards comes out of the box in the order:&#39;,cards,&#39;\n&#39;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; shuffle(cards)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(&#39;After shuffling the order of the deck of cards is:&#39;,cards&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;,&#39;\n&#39;&lt;/b&gt;&lt;b style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;if __name__ == &#39;__main__&#39;:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; main()&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;III. &amp;nbsp;PYTHON 3 RANDOM MODULE EXAMPLE OUTPUT&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;EXAMPLE 1:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp;The Python code randint(-10,10) produces a random integer between -10 and 10; e.g., -7 .&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;EXAMPLE 2:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp;Given the choice of pets is (&#39;dog&#39;, &#39;cat&#39;, &#39;turtle&#39;) choice(pet) randomly selects one of the pets; e.g., cat .&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;EXAMPLE 3:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp;Given a random number between one and ten; e.g., 8.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;You try to determine the random number and pick 6.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Your guess was wrong!&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;EXAMPLE 4:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: orange;&quot;&gt;The total number of the two dice you roll is&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp;6 .&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;EXAMPLE 5:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp;You walk into a cave looking for gold.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;You find gold!&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;EXAMPLE 6:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp;A deck of cards comes out of the box in the order: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52]&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;After shuffling the deck of cards is in the following order: [29, 25, 42, 44, 50, 6, 11, 14, 12, 30, 2, 39, 15, 49, 20, 24, 51, 1, 28, 45, 52, 9, 38, 27, 8, 41, 33, 40, 16, 26, 10, 36, 23, 21, 7, 22, 37, 19, 3, 46, 13, 31, 32, 5, 34, 17, 43, 48, 4, 35, 18, 47]&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;IV. &amp;nbsp;REFERENCES&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://docs.python.org/2/tutorial/&quot;&gt;The Python Tutorial by Guido van Rossum and Fred L. Drake, Jr., editor (2003)&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://www.python.org/dev/peps/pep-0008/&quot;&gt;Style Guide for Python Code by Guido van Rossum and Barry Warsaw (2001)&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;
&lt;b&gt;Enjoy the Python 3 Random Module!&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://goo.gl/qi5jw&quot;&gt;Elcric Otto Circle&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* One */
google_ad_slot = &quot;8813220342&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;

--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Two */
google_ad_slot = &quot;8243854886&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Three */
google_ad_slot = &quot;7921082405&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;g-plus&quot; data-action=&quot;share&quot; data-height=&quot;24&quot;&gt;
&lt;/div&gt;
&lt;b&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://goo.gl/Hm4Lb&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt; &lt;/span&gt;
&lt;/b&gt;&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;h1 style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;
&lt;span style=&quot;color: red;&quot;&gt;
How to Link to My Home Page&lt;/span&gt;&lt;/b&gt;&lt;/h1&gt;
&lt;form action=&quot;http://www.example.com/&quot;&gt;
&lt;b&gt;&lt;label for=&quot;linkcode&quot;&gt;
To link to &quot;MY Home Page&quot; from your website, simply copy and paste the following code into your website HTML page:
&lt;/label&gt;
&lt;textarea cols=&quot;43&quot; id=&quot;linkcode&quot; onclick=&quot;this.focus();this.select();&quot; readonly=&quot;readonly&quot; rows=&quot;5&quot; title=&quot;Select the text here, click your right mouse button, click the Copy menu item, and paste it into your web page in HTML source mode&quot;&gt;&lt;p&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;&lt;/p&gt;
&lt;/textarea&gt;
&lt;/b&gt;&lt;/form&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;It will appear on your website as:&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;
&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://pythonelcric.blogspot.com/2012/12/python-3-pickle-function-var-po-document.html</link><author>noreply@blogger.com (Ron Tinnel)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s72-c/avatar.gif" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-960876793746149434.post-7920500374093529058</guid><pubDate>Sun, 16 Dec 2012 05:15:00 +0000</pubDate><atom:updated>2013-03-03T13:36:07.825-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">pickle</category><category domain="http://www.blogger.com/atom/ns#">pyquick</category><category domain="http://www.blogger.com/atom/ns#">Python 3</category><title>PYTHON 3  PICKLE</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;title&gt;PYTHON 3 PICKLE&lt;/title&gt;
&lt;br /&gt;
&lt;div class=&quot;g-plusone&quot; data-annotation=&quot;inline&quot; data-width=&quot;300&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://www.elcricottocircle.blogspot.com/&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt;&lt;/span&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: xx-small;&quot;&gt;REVISED: Sunday, March 3, 2013&lt;/span&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: 800;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; imageanchor=&quot;1&quot; style=&quot;font-weight: bold; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;Python 3 &quot;Pickle&quot;.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;I. &amp;nbsp;PYTHON 3 &quot;PICKLE&quot; INTRODUCTION&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In Python to “pickle”, refers to a type of file input output (I/O) where you save a Python object to a file. Pickling stores objects on your hard drive instead of in your random access memory (RAM), short term memory, where the objects will be lost when you log out.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You can only pickle one object into one file.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;First, you have to import the Python &quot;pickle module&quot;, e.g., &lt;span style=&quot;color: magenta;&quot;&gt;import pickle&lt;/span&gt;. We need the Python “pickle module” to get the &quot;pickle dump&quot; function to dump the object we want to pickle into the file; e.g., &lt;span style=&quot;color: magenta;&quot;&gt;pickle.dump()&lt;/span&gt;.  Later we can use the Python &quot;pickle module&quot; &quot;pickle load&quot; function to un-pickle the object by pulling the object from the file; e.g., &lt;span style=&quot;color: magenta;&quot;&gt;pickle.load()&lt;/span&gt;.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Second, you have to create a file output “file object” using the Python “open method”; e.g., &lt;span style=&quot;color: magenta;&quot;&gt;outFile = open(‘pickleExample.txt’, ‘wb’)&lt;/span&gt;, which we open in binary mode; e.g.,&amp;nbsp;&lt;span style=&quot;color: magenta;&quot;&gt;‘wb’&lt;/span&gt; for write binary. I am using a text file named pickleExample; however, you can use any file name you prefer. I used outFile for the &quot;file object&quot;; however, any &quot;file object&quot; name can be used.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Third, you have to create a file input “file object” using the Python “open method”; e.g., &lt;span style=&quot;color: magenta;&quot;&gt;inFile = open(‘pickleExample.txt’, ‘rb’)&lt;/span&gt;, which we open in binary mode; e.g.,&amp;nbsp;&lt;span style=&quot;color: magenta;&quot;&gt;‘rb’&lt;/span&gt; for read binary. I am still using the original text file named pickleExample; you must use your original file name because that is the one you wrote to. I used inFile for the &quot;file object&quot;; however, any &quot;file object&quot; name can be used.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;II. &amp;nbsp;PYTHON 3 PICKLE EXAMPLE SOURCE CODE&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;import pickle&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;def main():&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; # Creating objects we want to pickle, write, to a file.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; pickleObjects = [&quot;home&quot;, &quot;library&quot;, &quot;garage&quot;, &quot;garden&quot;, &quot;pool&quot;, &quot;car&quot;]&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print (pickleObjects)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; # Pickling, writing, to a file.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; outFile = open(&#39;pickleExample.txt&#39;, &#39;wb&#39;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; pickle.dump(pickleObjects, outFile)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; outFile.close()&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; # Un-pickling, reading, from a file.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; inFile = open(&#39;pickleExample.txt&#39;, &#39;rb&#39;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; unPickledObjects = pickle.load(inFile)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print (unPickledObjects)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; inFile.close()&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;if __name__ == &#39;__main__&#39;:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; main()&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;III. &amp;nbsp;PYTHON 3 PICKLE EXAMPLE OUTPUT&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;[&#39;home&#39;, &#39;library&#39;, &#39;garage&#39;, &#39;garden&#39;, &#39;pool&#39;, &#39;car&#39;]&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;[&#39;home&#39;, &#39;library&#39;, &#39;garage&#39;, &#39;garden&#39;, &#39;pool&#39;, &#39;car&#39;]&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;IV. &amp;nbsp;REFERENCES&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://docs.python.org/2/tutorial/&quot;&gt;The Python Tutorial by Guido van Rossum and Fred L. Drake, Jr., editor (2003)&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://www.python.org/dev/peps/pep-0008/&quot;&gt;Style Guide for Python Code by Guido van Rossum and Barry Warsaw (2001)&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Enjoy Python 3 &quot;Pickle&quot;.&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://goo.gl/qi5jw&quot;&gt;Elcric Otto Circle&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* One */
google_ad_slot = &quot;8813220342&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;

--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Two */
google_ad_slot = &quot;8243854886&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Three */
google_ad_slot = &quot;7921082405&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;g-plus&quot; data-action=&quot;share&quot; data-height=&quot;24&quot;&gt;
&lt;/div&gt;
&lt;b&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://goo.gl/Hm4Lb&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt; &lt;/span&gt;
&lt;/b&gt;&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;h1 style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;
&lt;span style=&quot;color: red;&quot;&gt;
How to Link to My Home Page&lt;/span&gt;&lt;/b&gt;&lt;/h1&gt;
&lt;form action=&quot;http://www.example.com/&quot;&gt;
&lt;b&gt;&lt;label for=&quot;linkcode&quot;&gt;
To link to &quot;MY Home Page&quot; from your website, simply copy and paste the following code into your website HTML page:
&lt;/label&gt;
&lt;textarea cols=&quot;43&quot; id=&quot;linkcode&quot; onclick=&quot;this.focus();this.select();&quot; readonly=&quot;readonly&quot; rows=&quot;5&quot; title=&quot;Select the text here, click your right mouse button, click the Copy menu item, and paste it into your web page in HTML source mode&quot;&gt;&lt;p&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;&lt;/p&gt;
&lt;/textarea&gt;
&lt;/b&gt;&lt;/form&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;It will appear on your website as:&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;
&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://pythonelcric.blogspot.com/2012/12/python-pickle.html</link><author>noreply@blogger.com (Ron Tinnel)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s72-c/avatar.gif" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-960876793746149434.post-1648873128085509050</guid><pubDate>Tue, 04 Dec 2012 22:48:00 +0000</pubDate><atom:updated>2013-03-03T14:00:38.287-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">pyquick</category><category domain="http://www.blogger.com/atom/ns#">Python Set Theory and Logic</category><title>PYTHON 3 SET THEORY AND LOGIC</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;title&gt;PYTHON 3 SET THEORY AND LOIGIC&lt;/title&gt;
&lt;br /&gt;
&lt;div class=&quot;g-plusone&quot; data-annotation=&quot;inline&quot; data-width=&quot;300&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://www.elcricottocircle.blogspot.com/&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt;&lt;/span&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: xx-small;&quot;&gt;REVISED: Sunday, March 3, 2013&lt;/span&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: 800;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; imageanchor=&quot;1&quot; style=&quot;font-weight: bold; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;This tutorial discusses Python 3 &quot;Set Theory and Logic&quot;.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;I. &amp;nbsp;PYTHON 3 &quot;SET THEORY AND LOGIC&quot; INTRODUCTION&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;A set is an unordered collection of &quot;distinct&quot; objects; which means a set does not contain duplicate objects. Curly brackets &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;{ }&amp;nbsp;&lt;/span&gt;are used when detailing the contents of a set. For example, the set &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A&lt;/span&gt; would be written as&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;A = {a, b, c}&lt;/span&gt;. Set &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A&lt;/span&gt; has three members or elements: &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;a&lt;/span&gt;, &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;b&lt;/span&gt;, and &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;c&lt;/span&gt;. The set &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A&lt;/span&gt; is no different from &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;A = {b, a, c}&lt;/span&gt; because the ordering of the elements in a set does not matter. The only concept that really matters for any set is membership. The &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;∈&lt;/span&gt; sign denotes set membership, and can be read as &quot;in&quot;. If &quot;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;a&lt;/span&gt; is a member of the set &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A&lt;/span&gt;&quot; we write &amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;a ∈ A&lt;/span&gt;. And, if &quot;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;d&lt;/span&gt; is not a member of set &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A&lt;/span&gt;&quot;, we could write &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;d&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;background-color: white; font-size: 13.142857551574707px; line-height: 10.285714149475098px;&quot;&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;¬&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;∈ A&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In Python:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;def main():&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;A = set( [&#39;a&#39;, &#39;a&#39;, &#39;b&#39;, &#39;b&#39;,&#39;c&#39;, &#39;c&#39; ] )&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;print(&#39;Set A =&#39;,A)&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(&#39;&quot;a&quot; in A =&#39;,&quot;a&quot; in A)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(&#39;&quot;d&quot; in A =&#39;,&quot;d&quot; in A)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;if __name__ == &#39;__main__&#39;:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; main()&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Python display:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;Set A = {&#39;a&#39;, &#39;b&#39;, &#39;c&#39;}&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&quot;a&quot; in A = True&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&quot;d&quot; in A = False&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;A. CONDITIONAL STATEMENTS&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In English:&lt;/span&gt; In mathematics the study of logic deals with statements or propositions. A statement is &quot;a sentence that is either true or false, but not both&quot;. A conditional statement is two simple statements connected by the words if. . .then. (Dots like this “. . .” mean continue the pattern in the obvious way.) The first statement is called the hypothesis and the second statement is called the conclusion. Conditional statements are used in proving the validity of an argument through deductive reasoning. For example, if &quot;it is 32 degrees Celsius or colder outside&quot; then &quot;the water outside is frozen&quot;.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In Python:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;def main():&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Celsius = 32&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; if Celsius &amp;gt;= 32:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&quot;The water outside is frozen.&quot;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;if __name__ == &#39;__main__&#39;:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; main()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Python display:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;The water outside is frozen.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;B. INTERSECTION&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In English:&lt;/span&gt; If &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;A&lt;/span&gt; and &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;B&lt;/span&gt; are two sets taken from some universe &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;U&lt;/span&gt;, then the intersection of &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;A&lt;/span&gt; and &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;B&lt;/span&gt; written &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;A ∩ B&lt;/span&gt;, or &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;A&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;∧&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;B&lt;/span&gt;, is the set containing all elements common to sets &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;A&lt;/span&gt; and &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;B&lt;/span&gt;. An element is in the result if it is in one set and the other.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In Python:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;def main():&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; # Python &quot;Set Theory and Logic&quot; Intersection&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; U = set([&#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;d&#39;, &#39;e&#39;, &#39;f&#39;, &#39;g&#39;, &#39;h&#39;, &#39;i&#39;, &#39;j&#39;, &#39;k&#39;, &#39;l&#39;, &#39;m&#39;, &#39;n&#39;, &#39;o&#39;, &#39;p&#39;, &#39;q&#39;, &#39;r&#39;, &#39;s&#39;, &#39;t&#39;, &#39;u&#39;, &#39;v&#39;, &#39;w&#39;, &#39;x&#39;, &#39;y&#39;, &#39;z&#39;])&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; A = set( [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;])&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; B = set( [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;d&#39;])&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; C = set(A).intersection(B)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&quot;Consider some universe U =&quot;,U)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&quot;If A and B are two sets taken from the universe U such that&quot;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&quot;A =&quot;,A)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&quot;and&quot;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&quot;B =&quot;,B)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&quot;then&quot;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&quot;C = set(A).intersection(B) =&quot;,C)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;if __name__ == &#39;__main__&#39;:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; main()&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Python display:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;Consider some universe U = {&#39;m&#39;, &#39;l&#39;, &#39;o&#39;, &#39;n&#39;, &#39;i&#39;, &#39;h&#39;, &#39;k&#39;, &#39;j&#39;, &#39;e&#39;, &#39;d&#39;, &#39;g&#39;, &#39;f&#39;, &#39;a&#39;, &#39;c&#39;, &#39;b&#39;, &#39;y&#39;, &#39;x&#39;, &#39;z&#39;, &#39;u&#39;, &#39;t&#39;, &#39;w&#39;, &#39;v&#39;, &#39;q&#39;, &#39;p&#39;, &#39;s&#39;, &#39;r&#39;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;If A and B are two sets taken from the universe U such that&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;A = {&#39;a&#39;, &#39;c&#39;, &#39;b&#39;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;and&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;B = {&#39;d&#39;, &#39;a&#39;, &#39;c&#39;, &#39;b&#39;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;then&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;C = set(A).intersection(B) = {&#39;a&#39;, &#39;c&#39;, &#39;b&#39;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;C. UNION&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In English:&lt;/span&gt; If&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;A&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;B&lt;/span&gt;&amp;nbsp;are two sets taken from some universe&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;U&lt;/span&gt;, then the union of&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;A&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;B&lt;/span&gt;&amp;nbsp;written&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;A&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;text-align: start; white-space: pre-wrap;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;U&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;B&lt;/span&gt;, or &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;A&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;∨&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;B&lt;/span&gt;, is the set containing all elements in either&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;A&lt;/span&gt; or&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;B&lt;/span&gt;. An element is in the result if it is one set or the other.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In Python:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;def main():&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white; color: #222222; font-size: 13px; line-height: 9px;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;# Python &quot;Set Theory and Logic&quot; Union&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; U = set([&#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;d&#39;, &#39;e&#39;, &#39;f&#39;, &#39;g&#39;, &#39;h&#39;, &#39;i&#39;, &#39;j&#39;, &#39;k&#39;, &#39;l&#39;, &#39;m&#39;, &#39;n&#39;, &#39;o&#39;, &#39;p&#39;, &#39;q&#39;, &#39;r&#39;, &#39;s&#39;, &#39;t&#39;, &#39;u&#39;, &#39;v&#39;, &#39;w&#39;, &#39;x&#39;, &#39;y&#39;, &#39;z&#39;])&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; A = set( [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;])&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; B = set( [&#39;d&#39;, &#39;e&#39;, &#39;f&#39;])&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; C = A.union(B)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; print(&quot;Consider some universe U =&quot;,U)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&quot;If A and B are two sets taken from the universe U such that&quot;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(&quot;A =&quot;,A)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&quot;and&quot;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&quot;B =&quot;,B)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(&quot;then&quot;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(&quot;C = (A | B) =&quot;,C)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;
if __name__ == &#39;__main__&#39;:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; main()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Python display:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;Consider some universe U = {&#39;k&#39;, &#39;j&#39;, &#39;i&#39;, &#39;h&#39;, &#39;o&#39;, &#39;n&#39;, &#39;m&#39;, &#39;l&#39;, &#39;c&#39;, &#39;b&#39;, &#39;a&#39;, &#39;g&#39;, &#39;f&#39;, &#39;e&#39;, &#39;d&#39;, &#39;z&#39;, &#39;y&#39;, &#39;x&#39;, &#39;s&#39;, &#39;r&#39;, &#39;q&#39;, &#39;p&#39;, &#39;w&#39;, &#39;v&#39;, &#39;u&#39;, &#39;t&#39;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;If A and B are two sets taken from the universe U such that&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;A = {&#39;c&#39;, &#39;b&#39;, &#39;a&#39;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;and&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;B = {&#39;f&#39;, &#39;e&#39;, &#39;d&#39;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;then&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;C = (A | B) = {&#39;c&#39;, &#39;b&#39;, &#39;a&#39;, &#39;f&#39;, &#39;e&#39;, &#39;d&#39;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;D. DIFFERENCE&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In English:&lt;/span&gt;&amp;nbsp;Given two sets:&amp;nbsp;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;A = set( [&#39;a&#39;, &#39;a&#39;, &#39;b&#39;, &#39;b&#39;, &#39;c&#39;, &#39;c&#39;, &#39;d&#39;,&#39;e&#39;, &#39;f&#39; ] ) &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;B = set( [&#39;a&#39;, &#39;b&#39;, &#39;c&#39; ] )&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;the difference, &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;C = A - B,&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; will be such that a&lt;/span&gt;&lt;/b&gt;&lt;b&gt;n element will be in set &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;C&lt;/span&gt; if it is in set &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A&lt;/span&gt; and not in set &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;B&lt;/span&gt;.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In Python:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt;def main():&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&amp;nbsp; &amp;nbsp; A = set( [&#39;a&#39;, &#39;a&#39;, &#39;b&#39;, &#39;b&#39;, &#39;c&#39;, &#39;c&#39;, &#39;d&#39;,&#39;e&#39;, &#39;f&#39; ] )&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&amp;nbsp; &amp;nbsp; B = set( [&#39;a&#39;, &#39;b&#39;, &#39;c&#39; ] )&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&amp;nbsp; &amp;nbsp; C = A - B&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&quot;C =&quot;,C)&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;if __name__ == &#39;__main__&#39;:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; main()&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-weight: normal;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Python display:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;C = {&#39;f&#39;, &#39;d&#39;, &#39;e&#39;}&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;II. &amp;nbsp;PYTHON 3 SET OPERATIONS&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;There are a large number of set operations, including &quot;Union&quot; (&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;|&lt;/span&gt;), &quot;Intersection&quot; (&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;amp;&lt;/span&gt;), &quot;Difference&quot; (&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;-&lt;/span&gt;), and &quot;Symmetric Difference&quot; (&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;^&lt;/span&gt;), also called &quot;Exclusive Or&quot;, which is all elements in set &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A&lt;/span&gt; or set &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;B&lt;/span&gt; but not both. You can also test to see if &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A&lt;/span&gt; is a Subset of &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;B&lt;/span&gt; and if &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;B&lt;/span&gt; is a Superset of &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A&lt;/span&gt;.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In Python:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;def main():&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; A = set( [&#39;a&#39;, &#39;a&#39;, &#39;b&#39;, &#39;b&#39;, &#39;c&#39;, &#39;c&#39;, &#39;d&#39;,&#39;e&#39;, &#39;f&#39; ] )&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; B = set( [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;z&#39; ] )&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;C = set( [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;w&#39;, &#39;z&#39; ] )&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&#39;The Union A | B is a new set with elements from both A and B =&#39;, A | B&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;, &quot;\n&quot;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&#39;The Intersection A &amp;amp; B is a new set with elements common to A and B =&#39;, A &amp;amp; B&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;, &quot;\n&quot;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&#39;The Difference A - B is a new set with elements in A but not in B =&#39;, A - B&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;, &quot;\n&quot;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&#39;The Symmetric Difference A ^ B&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;is a new set with elements in either A or B but not both&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;=&#39;, A ^ B&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;, &quot;\n&quot;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;print(&#39;Is B a subset of C?&amp;nbsp;In other words, is every element in B also in C?&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&#39;,B &amp;lt;= C&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;, &quot;\n&quot;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;)&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(&#39;Is C a superset of B? In other words, is every element in B also in C?&#39;,C &amp;gt;= B)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;if __name__ == &#39;__main__&#39;:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; main()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-weight: normal;&quot;&gt;
&lt;b&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Python display:&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-weight: normal;&quot;&gt;
&lt;/div&gt;
&lt;b&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-weight: normal;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;The Union A | B&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;is a new set with elements from both A and B&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;= {&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&#39;z&#39;,&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&#39;d&#39;, &#39;e&#39;, &#39;f&#39;, &#39;a&#39;, &#39;b&#39;, &#39;c&#39;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;The Intersection A &amp;amp; B&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;is a new set with elements common to A and B&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;= {&#39;a&#39;, &#39;b&#39;, &#39;c&#39;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;The Difference A - B&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;is a new set with elements in A but not in B&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;= {&#39;d&#39;, &#39;e&#39;, &#39;f&#39;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;The Symmetric Difference A ^ B is a new set with elements in either A or B but not both = {&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&#39;z&#39;,&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&#39;d&#39;, &#39;e&#39;, &#39;f&#39;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;Is B a subset of C? In other words, is every element in B also in C? True&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;Is C a superset of B? In other words, is every element in B also in C? True&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;III. &amp;nbsp;REFERENCES&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://docs.python.org/2/tutorial/&quot;&gt;The Python Tutorial by Guido van Rossum and Fred L. Drake, Jr., editor (2003)&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://www.python.org/dev/peps/pep-0008/&quot;&gt;Style Guide for Python Code by Guido van Rossum and Barry Warsaw (2001)&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;
&lt;b&gt;In this tutorial, you have been presented with a basic introduction to Python 3 &quot;Set Theory and Logic&quot;.&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://goo.gl/qi5jw&quot;&gt;Elcric Otto Circle&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* One */
google_ad_slot = &quot;8813220342&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;

--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Two */
google_ad_slot = &quot;8243854886&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Three */
google_ad_slot = &quot;7921082405&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;g-plus&quot; data-action=&quot;share&quot; data-height=&quot;24&quot;&gt;
&lt;/div&gt;
&lt;b&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://goo.gl/Hm4Lb&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt; &lt;/span&gt;
&lt;/b&gt;&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;h1 style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;
&lt;span style=&quot;color: red;&quot;&gt;
How to Link to My Home Page&lt;/span&gt;&lt;/b&gt;&lt;/h1&gt;
&lt;form action=&quot;http://www.example.com/&quot;&gt;
&lt;b&gt;&lt;label for=&quot;linkcode&quot;&gt;
To link to &quot;MY Home Page&quot; from your website, simply copy and paste the following code into your website HTML page:
&lt;/label&gt;
&lt;textarea cols=&quot;43&quot; id=&quot;linkcode&quot; onclick=&quot;this.focus();this.select();&quot; readonly=&quot;readonly&quot; rows=&quot;5&quot; title=&quot;Select the text here, click your right mouse button, click the Copy menu item, and paste it into your web page in HTML source mode&quot;&gt;&lt;p&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;&lt;/p&gt;
&lt;/textarea&gt;
&lt;/b&gt;&lt;/form&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;It will appear on your website as:&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;
&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://pythonelcric.blogspot.com/2012/12/python-set-theory-and-logic.html</link><author>noreply@blogger.com (Ron Tinnel)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s72-c/avatar.gif" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-960876793746149434.post-1232189804004255160</guid><pubDate>Wed, 28 Nov 2012 00:20:00 +0000</pubDate><atom:updated>2013-03-03T14:01:43.462-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">pyquick</category><category domain="http://www.blogger.com/atom/ns#">Python 3 credit card class source code</category><title>PYTHON 3 &quot;CREDIT CARD CLASS&quot; SOURCE CODE</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;title&gt;PYTHON 3 &quot;CREDIT CARD CLASS&quot; SOURCE CODE&lt;/title&gt;
&lt;br /&gt;
&lt;div class=&quot;g-plusone&quot; data-annotation=&quot;inline&quot; data-width=&quot;300&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://www.elcricottocircle.blogspot.com/&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt;&lt;/span&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: xx-small;&quot;&gt;REVISED: Sunday, March 3, 2013&lt;/span&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: 800;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; imageanchor=&quot;1&quot; style=&quot;font-weight: bold; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;This tutorial discusses the basic design of a Python 3 &quot;credit card class&quot;.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;I. &amp;nbsp;PYTHON 3 &quot;CREDIT CARD CLASS&quot; SOURCE CODE&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Consider the following Python 3 &quot;credit card class&quot; source code:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;class CreditCard:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;def __init__(self,&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp;title = &quot; &quot;, first_name = &quot; &quot;, last_name = &quot; &quot;, city = &quot; &quot;, state = &quot; &quot;, country = &quot; &quot;, zip_code = &quot; &quot;, card_number = 0, exp_month = &quot; &quot;, exp_year = 0, cvv2 = &quot; &quot;, card_type = &quot; &quot;, currency_code = &quot; &quot;, account = &quot; &quot;,&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;line_of_credit = 0, beginning_balance = 0, account_balance = 0, charges = 0, overdraft_fees = 0, payments = 0, ending_balance = 0):&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&quot;&quot;&quot; Opens an account. &quot;&quot;&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;self.title = title&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.first_name = first_name&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.last_name = last_name&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.city = city&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.state = state&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.country = country&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.zip_code = zip_code&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;self.card_number = card_number&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.expiration_month = exp_month&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.expiration_year = exp_year&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.security_code = cvv2&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.card_type = card_type&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.currency_code = currency code&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.account = account&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.line_of_credit = line_of_credit&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.beginning_balance = beginning_balance&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.account_balance = account_balance&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.charges = charges&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.overdraft_fees = overdraft_fees&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.payments = payments&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.ending_balance = ending_balance&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;def create_account(self, account):&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;&quot;&quot; Establishes account. &quot;&quot;&quot;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.account = account&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; def create_line_of_credit(self, amount):&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&quot;&quot;&quot; Establishes line of credit. &quot;&quot;&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.line_of_credit += amount&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; def create_beginning_balance(self, amount):&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&quot;&quot;&quot; Establiishes beginning balance. &quot;&quot;&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.beginning_balance += amount&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.account_balance += amount&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.ending_balance += amount&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; def create_charges(self, amount):&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&quot;&quot;&quot;Reduces the amount from the account balance.&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Each charge resulting in an over draft negative account balance&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;also deducts a fee of 25 dollars from the account balance.&quot;&quot;&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.account_balance -= amount&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.ending_balance -= amount&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if self.account_balance &amp;lt; 0:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.account_balance -= 25&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.ending_balance -= 25&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.overdraft_fee += 25&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; def create_payments(self, amount):&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&quot;&quot;&quot;Deposits the amount into the account balance.&quot;&quot;&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.account_balance += amount&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.ending_balance += amount&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.payments += amount&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; def display_line_of_credit(self):&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&quot;&quot;&quot;Returns the current balance in the account.&quot;&quot;&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print (&quot;Line Of Credit: &amp;nbsp; &amp;nbsp;%s\n&quot; % str(self.line_of_credit))&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; def display_beginning_balance(self):&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&quot;&quot;&quot; Returns the beginning balance. &quot;&quot;&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print (&quot;Beginning Balance: %s&quot; % str(self.beginning_balance))&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; def display_charges(self):&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&quot;&quot;&quot; Returns total charges. &quot;&quot;&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print (&quot;- Charges: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %s&quot; % str(self.charges))&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; def display_fees(self):&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&quot;&quot;&quot;Returns the total fees.&quot;&quot;&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print (&quot;- Overdraft Fees: &amp;nbsp; %s&quot; % str(self.overdraft_fee))&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; def display_payments(self):&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&quot;&quot;&quot; Returns total payments. &quot;&quot;&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print (&quot;+ Payments: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%s&quot; % str(self.payments))&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; def display_account_balance(self):&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&quot;&quot;&quot; Returns the account balance. &quot;&quot;&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print (&quot;Account Balance: &amp;nbsp; &amp;nbsp;%s&quot; % str(self.account_balance))&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; def display_ending_balance(self):&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&quot;&quot;&quot; Returns the ending balance. &quot;&quot;&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print (&quot;Ending Balance: &amp;nbsp; &amp;nbsp;%s&quot; % str(self.ending_balance))&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;def __str__(self):&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;s = &quot;Account: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%s\n&quot; % (self.account)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s += &quot;Line Of Credit: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%s\n&quot; % (self.line_of_credit)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s += &quot;Beginning Balance: %s\n&quot; % (self.beginning_balance)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s += &quot;- Charges: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %s\n&quot; % (self.charges)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s += &quot;- Overdraft Fees: &amp;nbsp; &amp;nbsp; %s\n&quot; % (self.overdraft_fees)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s += &quot;+ Payments: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%s\n&quot; % (self.payments)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s += &quot;Ending Balance: &amp;nbsp; &amp;nbsp; &amp;nbsp; %s\n&quot; % (self.ending_balance)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return s&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;II.  PYTHON 3 &quot;CREDIT CARD CLASS&quot; OBJECT INSTANTIATION&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;def main():&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; my_creditcard = CreditCard()&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;III. &amp;nbsp;CALLING PYTHON 3 &quot;CREDIT CARD CLASS&quot; OBJECT METHODS&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;my_creditcard.create_account(&quot;my_creditcard&quot;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; my_creditcard.create_line_of_credit(5000)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; my_creditcard.create_beginning_balance(4000)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; my_creditcard.create_charges(3000)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; my_creditcard.create_payments(2000)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;IV. &amp;nbsp;DISPLAYING PYTHON 3 &quot;CREDIT CARD CLASS&quot; DATA&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;print (my_creditcard)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;if __name__ == &#39;__main__&#39;:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; main()&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;V. &amp;nbsp;SAMPLE PYTHON 3 &quot;CREDIT CARD CLASS&quot; DISPLAY OUTPUT&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;Account: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;my_creditcard&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;Line Of Credit: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5000&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;Beginning Balance: 4000&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;- Charges: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3000&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;- Overdraft Fees: &amp;nbsp; &amp;nbsp; 0&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;+ Payments: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2000&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;Ending Balance: &amp;nbsp; &amp;nbsp; &amp;nbsp; 3000&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;VI. &amp;nbsp;REFERENCES&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://docs.python.org/2/tutorial/&quot;&gt;The Python Tutorial by Guido van Rossum and Fred L. Drake, Jr., editor (2003)&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://www.python.org/dev/peps/pep-0008/&quot;&gt;Style Guide for Python Code by Guido van Rossum and Barry Warsaw (2001)&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;
&lt;b&gt;In this tutorial, you have learned the basic design of a Python 3 &quot;credit card class&quot;.&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://goo.gl/qi5jw&quot;&gt;Elcric Otto Circle&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* One */
google_ad_slot = &quot;8813220342&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;

--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Two */
google_ad_slot = &quot;8243854886&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Three */
google_ad_slot = &quot;7921082405&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;g-plus&quot; data-action=&quot;share&quot; data-height=&quot;24&quot;&gt;
&lt;/div&gt;
&lt;b&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://goo.gl/Hm4Lb&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt;  &lt;/span&gt;
&lt;/b&gt;&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;h1 style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;
&lt;span style=&quot;color: red;&quot;&gt;
How to Link to My Home Page&lt;/span&gt;&lt;/b&gt;&lt;/h1&gt;
&lt;form action=&quot;http://www.example.com/&quot;&gt;
&lt;b&gt;&lt;label for=&quot;linkcode&quot;&gt;
To link to &quot;MY Home Page&quot; from your website, simply copy and paste the following code into your website HTML page:
&lt;/label&gt;
&lt;textarea cols=&quot;43&quot; id=&quot;linkcode&quot; onclick=&quot;this.focus();this.select();&quot; readonly=&quot;readonly&quot; rows=&quot;5&quot; title=&quot;Select the text here, click your right mouse button, click the Copy menu item, and paste it into your web page in HTML source mode&quot;&gt;&lt;p&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;&lt;/p&gt;
&lt;/textarea&gt;
&lt;/b&gt;&lt;/form&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;It will appear on your website as:&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;
&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://pythonelcric.blogspot.com/2012/11/creating-python-3-class-function-var-po.html</link><author>noreply@blogger.com (Ron Tinnel)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s72-c/avatar.gif" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-960876793746149434.post-2365162409389326492</guid><pubDate>Tue, 20 Nov 2012 22:29:00 +0000</pubDate><atom:updated>2013-03-03T15:14:17.639-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">class</category><category domain="http://www.blogger.com/atom/ns#">object oriented programming (OOP) language</category><category domain="http://www.blogger.com/atom/ns#">pyquick</category><category domain="http://www.blogger.com/atom/ns#">Python 3</category><title>CREATING A PYTHON 3 CLASS</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;title&gt;CREATING A PYTHON 3 CLASS&lt;/title&gt;
&lt;br /&gt;
&lt;div class=&quot;g-plusone&quot; data-annotation=&quot;inline&quot; data-width=&quot;300&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://www.elcricottocircle.blogspot.com/&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt;&lt;/span&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: xx-small;&quot;&gt;REVISED: Sunday, March 3, 2013&lt;/span&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: 800;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; imageanchor=&quot;1&quot; style=&quot;font-weight: bold; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;Python class.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;I. &amp;nbsp;PYTHON CLASS INTRODUCTION&lt;/b&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;A class is known as a &quot;data structure&quot;, a blueprint of the data, and methods required to process that data. Classes group together variable attributes and function methods, so both the data and the code to process the data are in the same place in the program.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Python is an &quot;object-oriented programming&quot; (OOP) language. All data entities in Python are objects. Python was designed to make it very easy to create and define your own classes; inherit from your own or built-in classes; and instantiate objects from the classes you define.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Other than a name, there is nothing that a Python class must have. And, all names in Python are case-sensitive.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The default encoding for&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;.py&lt;/span&gt;&amp;nbsp;files was ascii i&lt;/b&gt;&lt;b&gt;n Python 2.&amp;nbsp;&lt;/b&gt;&lt;b&gt;The default encoding is utf-8 i&lt;/b&gt;&lt;b&gt;n Python 3.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;II.  PYTHON CLASS CREATION SYNTAX&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Classes are defined using the word &quot;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;class&lt;/span&gt;&quot; instead of &quot;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;def&lt;/span&gt;&quot;. A Python class starts with the reserved word &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;class&lt;/span&gt;, followed by the class name, and ending with a colon (&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;:&lt;/span&gt;). A generally accepted programming practice is to capitalize Python class names. Class names are in &quot;camel case&quot;; with no spaces or underlines, and the first letter of each word is capitalized. Classes  should have documentation strings, a docstring, to explain their purpose, just like modules and functions. Triple quotes signify a multi-line documentation string, docstring.&amp;nbsp;&lt;/b&gt;&lt;b&gt;Carriage returns, leading white space, and other quote characters&amp;nbsp;&lt;/b&gt;&lt;b&gt;between the start and end quotes is part of a single string, docstring. All methods have a built-in attribute &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;__doc__&lt;/span&gt;, which returns the docstring if a docstring is defined in the method’s source code.&amp;nbsp;&lt;/b&gt;&lt;b&gt;When you type a function name, its docstring appears as a tooltip when you are using a&amp;nbsp;&lt;/b&gt;&lt;b&gt;Python IDE which uses the docstring to provide context-sensitive documentation.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;class ClassName:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&quot;&quot;&quot;Class description documentation string.&quot;&quot;&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;def __init__(self):&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&quot;&quot;&quot;Class variables should be defined and initialized inside this method.&quot;&quot;&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;self.data = []&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Class definitions, like function definitions must be executed before they have any effect.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The only delimiters in Python are the colon (&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;:&lt;/span&gt;) and the indentation of the code itself. Hence, whitespace and indents are important. Whitespace signifies e&lt;/b&gt;&lt;b&gt;nd-of-line and code blocks in&amp;nbsp;&lt;/b&gt;&lt;b&gt;Python. Everything within a Python class is indented four spaces, just like the code within a function, &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;if&lt;/span&gt; statement, &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;for&lt;/span&gt; loop, and so on. The first code not indented is not in the class.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Instead of explicit constructors and destructors, Python classes have the&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;__init__()&lt;/span&gt; method. By convention,&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;__init__()&lt;/span&gt;&amp;nbsp;is normally called immediately after an instance of the class is created. The instantiation operation of “calling” a class object creates an empty object.&amp;nbsp;&lt;/b&gt;&lt;b&gt;A class can define the special method named&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;__init__()&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&amp;nbsp;to create objects with instances customized to a specific initial state&lt;span style=&quot;font-family: inherit;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;By convention &lt;/span&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;__init__()&lt;/span&gt; is normally both the first method defined for a class, and the first piece of code executed in a newly created instance of a class. However, the object has already been constructed by the time &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;__init__()&lt;/span&gt; is called; therefore, you already have a valid reference to the new instance of the class before &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;__init__()&lt;/span&gt; is executed. Python methods have attributes, and those attributes are available at runtime. A method, like everything else in Python, is an object in the sense that an object can be assigned to a variable or passed as an argument to a method. Everything in Python is an object!&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The first argument of every class method,&amp;nbsp;&lt;/b&gt;&lt;b&gt;is always a reference to the current instance of the class,&amp;nbsp;&lt;/b&gt;&lt;b&gt;including &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;__init__&lt;/span&gt;. This argument is always named &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;self&lt;/span&gt;. &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;self&lt;/span&gt; is a temporary placeholder for the object name of&amp;nbsp;&lt;/b&gt;&lt;b&gt;the instance whose method was called&lt;/b&gt;&lt;b&gt;. In the &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;__init__&lt;/span&gt; method, &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;self&lt;/span&gt; refers to the newly created object. You need to specify &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;self&lt;/span&gt; explicitly when defining the method; however, you do not specify&amp;nbsp;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;self&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&amp;nbsp;when calling the method; Python will add &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;self&lt;/span&gt; for you automatically. This argument fills the role of the reserved word &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;this&lt;/span&gt; in C++ or Java; however,&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;self&lt;/span&gt; is not a reserved word in Python&lt;/b&gt;&lt;b&gt;.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;III. &amp;nbsp;PYTHON CLASS OBJECT INSTANTIATION&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Instantiating a new instance object of a Python class is done using the Python class name and parenthesis in the form of function notation. For example, when you create instances of a Python class, you call the Python class using the Python class name and pass in whatever arguments its &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;__init__&lt;/span&gt; method accepts.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;new_object = ClassName( )&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;__init__() &lt;/span&gt;method may have arguments. Arguments given to the class instantiation operator are passed on to &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;__init__()&lt;/span&gt;.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;IV. &amp;nbsp;PYTHON INSTANCE OBJECTS&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The object class,&amp;nbsp;&lt;/b&gt;&lt;b&gt;of a class instance, has a built-in attribute, &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;__class__&lt;/span&gt;. The only operations understood by instance objects are attribute references.&amp;nbsp;&lt;/b&gt;&lt;b&gt;Data attributes and methods&lt;/b&gt;&lt;b&gt;&amp;nbsp;are the only two kinds of valid attribute names.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The data for objects in the class are contained in user-defined fields. Data attributes need not be declared; like local variables, they come into existence when they are first assigned.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;A variable inside a class is known as an Attribute. Classes can be used to keep track of variables and perform operations on them. The values of the class&#39; variables are known as its state. To tell the class to keep track
of a variable, the first parameter, &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;self&lt;/span&gt;, is used. Global statements are not needed to change class variables. You can reference global variables inside of your class, but you need to declare them as such if you plan on modifying them.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;V. &amp;nbsp;PYTHON METHOD OBJECTS&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Explicitly list&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;self&lt;/span&gt;&amp;nbsp;as the first argument for each method&amp;nbsp;&lt;/b&gt;&lt;b&gt;when defining class methods,&amp;nbsp;including &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;__init__&lt;/span&gt;.&amp;nbsp;&lt;/b&gt;&lt;b&gt;Include the&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;self&lt;/span&gt;&amp;nbsp;argument w&lt;/b&gt;&lt;b&gt;hen calling a method of an ancestor class from within a class. &lt;/b&gt;&lt;b&gt;Python automatically adds the instance reference for you&amp;nbsp;&lt;/b&gt;&lt;b&gt;when you call your class method from outside; therefore, do not specify anything for the &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;self&lt;/span&gt; argument.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Functions inside a class, that manipulate the data in the user defined fields, are known as methods. Python methods have special characteristics. For example, the object is passed as the first argument of the method. And, in other languages you might have learned to specify the datatype of the function return value and each function argument. However, in Python, you never explicitly specify the datatype of anything.&amp;nbsp;&lt;/b&gt;&lt;b&gt;Python keeps track of the datatype internally b&lt;/b&gt;&lt;b&gt;ased on what value you assign. Also, Python allows method arguments to have default values; if the method is called without the argument, the argument gets its default value. When you use&amp;nbsp;&lt;/b&gt;&lt;b&gt;named arguments, a&lt;/b&gt;&lt;b&gt;rguments can be specified in any order.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The keyword &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;def&lt;/span&gt; starts the method declaration, followed by the method name, followed by the arguments in parentheses.&amp;nbsp;&lt;/b&gt;&lt;b&gt;The object is passed as the first argument of the method, and m&lt;/b&gt;&lt;b&gt;ultiple arguments are separated with commas.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Everything in Python is a function.&amp;nbsp;&lt;/b&gt;&lt;b&gt;There are no subroutines in Python. All functions return a value, even if the value is the built-in null object named&amp;nbsp;&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;None&lt;/span&gt;, and all functions start with &lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;def&lt;/span&gt;.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;A function that “belongs to” an object is called a&lt;/b&gt;&lt;b&gt;&amp;nbsp;method.&amp;nbsp;&lt;/b&gt;&lt;b&gt;Methods of the same class can be called by those c&lt;/b&gt;&lt;b&gt;lasses. Class methods may reference global names in the same way as ordinary functions.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;VI. &amp;nbsp;PYTHON CLASS EXAMPLE SOURCE CODE&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;class Wonder:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; # Class variables: __object_count is a class variable that is shared by all instances of the class. Class variables are defined within a class but outside any of the class&#39;s methods.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; __object_count = 0&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; def __init__(self, name=&quot; &quot;, smiling = False, waving = False):&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; May the Force be with you!&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Live long and prosper!&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Instance variables:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.name = name&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.smiling = smiling&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.waving = waving&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print (&quot;Hello, I am {0} an object of Wonder!\n&quot;.format(self.name))&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Wonder.__object_count += 1&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print (&quot;Total Objects: &quot; + str(Wonder.__object_count) + &quot;\n&quot;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; # Static methods:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; @staticmethod&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; def get_object_count():&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return Wonder.__object_count&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; # Instance methods:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; def greet(self):&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print (self.name + &quot; is pleased to meet you.\n&quot;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.smiling = True&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.waving = True&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; def __str__(self):&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if self.smiling:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; smiling_s = &quot;smiling&quot;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; smiling_s = &quot;not smiling&quot;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if self.waving:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; waving_s = &quot;waving&quot;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; waving_s = &quot;not waving&quot;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &quot;%s is %s and %s.\n&quot; % (self.name, smiling_s, waving_s)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;def main():&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; ww = Wonder(&quot;Yoda&quot;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; ww.greet()&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(ww)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; ww2 = Wonder(&quot;R2D2&quot;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; ww2.greet()&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(ww2)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print (ww.__init__.__doc__)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; print(Wonder.get_object_count())&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;if __name__ == &#39;__main__&#39;:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; main()&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;VII. PYTHON CLASS EXAMPLE DISPLAY&lt;/span&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Hello, I am Yoda an object of Wonder!&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Total Objects: 1&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Yoda is pleased to meet you.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Yoda is smiling and waving.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Hello, I am R2D2 an object of Wonder!&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Total Objects: 2&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;R2D2 is pleased to meet you.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;R2D2 is smiling and waving.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; May the Force be with you!&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Live long and prosper!&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;2&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;VIII. &amp;nbsp;REFERENCES&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;a href=&quot;http://docs.python.org/2/tutorial/&quot;&gt;The Python Tutorial by Guido van Rossum and Fred L. Drake, Jr., editor (2003)&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://www.python.org/dev/peps/pep-0008/&quot;&gt;Style Guide for Python Code by Guido van Rossum and Barry Warsaw (2001)&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;
&lt;b&gt;Enjoy creating a Python classes!&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://goo.gl/qi5jw&quot;&gt;Elcric Otto Circle&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* One */
google_ad_slot = &quot;8813220342&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;

--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Two */
google_ad_slot = &quot;8243854886&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Three */
google_ad_slot = &quot;7921082405&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;g-plus&quot; data-action=&quot;share&quot; data-height=&quot;24&quot;&gt;
&lt;/div&gt;
&lt;b&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://goo.gl/Hm4Lb&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt;  &lt;/span&gt;
&lt;/b&gt;&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;h1 style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;
&lt;span style=&quot;color: red;&quot;&gt;
How to Link to My Home Page&lt;/span&gt;&lt;/b&gt;&lt;/h1&gt;
&lt;form action=&quot;http://www.example.com/&quot;&gt;
&lt;b&gt;&lt;label for=&quot;linkcode&quot;&gt;
To link to &quot;MY Home Page&quot; from your website, simply copy and paste the following code into your website HTML page:
&lt;/label&gt;
&lt;textarea cols=&quot;43&quot; id=&quot;linkcode&quot; onclick=&quot;this.focus();this.select();&quot; readonly=&quot;readonly&quot; rows=&quot;5&quot; title=&quot;Select the text here, click your right mouse button, click the Copy menu item, and paste it into your web page in HTML source mode&quot;&gt;&lt;p&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;&lt;/p&gt;
&lt;/textarea&gt;
&lt;/b&gt;&lt;/form&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;It will appear on your website as:&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;
&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://pythonelcric.blogspot.com/2012/11/creating-python-class.html</link><author>noreply@blogger.com (Ron Tinnel)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s72-c/avatar.gif" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-960876793746149434.post-8052514868749240256</guid><pubDate>Mon, 03 Sep 2012 16:15:00 +0000</pubDate><atom:updated>2013-03-03T15:17:13.275-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Google PyQuick</category><category domain="http://www.blogger.com/atom/ns#">HTTP Exceptions</category><category domain="http://www.blogger.com/atom/ns#">Nick Parlante</category><category domain="http://www.blogger.com/atom/ns#">OS</category><category domain="http://www.blogger.com/atom/ns#">OS commands</category><category domain="http://www.blogger.com/atom/ns#">pyquick</category><category domain="http://www.blogger.com/atom/ns#">Regular Expressions</category><category domain="http://www.blogger.com/atom/ns#">URLs</category><category domain="http://www.blogger.com/atom/ns#">Utilities</category><title>GOOGLE PYQUICK PYTHON VIDEO TUTORIALS DAY 2</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;title&gt;GOOGLE PYQUICK PYTHON VIDEO TUTORIALS DAY 2&lt;/title&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;g-plusone&quot; data-annotation=&quot;inline&quot; data-width=&quot;300&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;




&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://www.elcricottocircle.blogspot.com/&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt;&lt;/span&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: xx-small;&quot;&gt;REVISED: Sunday, March 3, 2013&lt;/span&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: 800;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; imageanchor=&quot;1&quot; style=&quot;font-weight: bold; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif; font-size: large;&quot;&gt;GOOGLE PYQUICK PYTHON&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif; font-size: large;&quot;&gt;VIDEO TUTORIALS&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif; font-size: large;&quot;&gt;BY NICK PARLANTE&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;I. GOOGLE PYQUICK PYTHON VIDEO TUTORIALS DAY 2&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;There are four parts to &quot;Day 2&quot; of the Google PyQuick Python class by Nick Parlante. &quot;Part 1&quot; covers regular expressions. &quot;Part 2&quot; covers utilities, and OS commands. &quot;Part 3&quot; covers utilities, URLs, and HTTP expressions. &quot;Part 4&quot; has the closing comments.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;Part 1: Regular Expressions&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/kWyoYtvJpe4?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;Part 2: Utilities - OS and Commands&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/uKZ8GBKmeDM?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;Part 3: Utilities - URLs and HTTP Exceptions&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/Nn2KQmVF5Og?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;Part 4: Closing Comments&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/IcteAbMC1Ok?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://goo.gl/qi5jw&quot;&gt;Elcric Otto Circle&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* One */
google_ad_slot = &quot;8813220342&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;

--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Two */
google_ad_slot = &quot;8243854886&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Three */
google_ad_slot = &quot;7921082405&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://goo.gl/Hm4Lb&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt;  &lt;/span&gt;&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;g-plus&quot; data-action=&quot;share&quot; data-height=&quot;24&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;h1 style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;
How to Link to My Home Page&lt;/span&gt;&lt;/h1&gt;
&lt;form action=&quot;http://www.example.com/&quot;&gt;
&lt;label for=&quot;linkcode&quot;&gt;
To link to &quot;MY Home Page&quot; from your website, simply copy and paste the following code into your website HTML page:
&lt;/label&gt;
&lt;textarea cols=&quot;43&quot; id=&quot;linkcode&quot; onclick=&quot;this.focus();this.select();&quot; readonly=&quot;readonly&quot; rows=&quot;5&quot; title=&quot;Select the text here, click your right mouse button, click the Copy menu item, and paste it into your web page in HTML source mode&quot;&gt;&lt;p&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;&lt;/p&gt;
&lt;/textarea&gt;
&lt;/form&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;It will appear on your website as:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://pythonelcric.blogspot.com/2012/09/google-video-python-tutorials-day-2.html</link><author>noreply@blogger.com (Ron Tinnel)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s72-c/avatar.gif" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-960876793746149434.post-8029477855041244195</guid><pubDate>Mon, 03 Sep 2012 08:24:00 +0000</pubDate><atom:updated>2013-03-03T15:17:59.056-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">dictionaries</category><category domain="http://www.blogger.com/atom/ns#">files</category><category domain="http://www.blogger.com/atom/ns#">Google PyQuick</category><category domain="http://www.blogger.com/atom/ns#">lists</category><category domain="http://www.blogger.com/atom/ns#">Nick Parlante</category><category domain="http://www.blogger.com/atom/ns#">Python</category><category domain="http://www.blogger.com/atom/ns#">sorting</category><category domain="http://www.blogger.com/atom/ns#">strings</category><category domain="http://www.blogger.com/atom/ns#">tuples</category><title>GOOGLE PYQUICK PYTHON VIDEO TUTORIALS DAY 1</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;title&gt;GOOGLE PYQUICK PYTHON VIDEO TUTORIALS DAY 1&lt;/title&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;g-plusone&quot; data-annotation=&quot;inline&quot; data-width=&quot;300&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://www.elcricottocircle.blogspot.com/&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt;&lt;/span&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: xx-small;&quot;&gt;REVISED: Sunday, March 3, 2013&lt;/span&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: 800;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; imageanchor=&quot;1&quot; style=&quot;font-weight: bold; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif; font-size: large;&quot;&gt;GOOGLE PYQUICK PYTHON&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif; font-size: large;&quot;&gt;VIDEO TUTORIALS&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif; font-size: large;&quot;&gt;&amp;nbsp;BY NICK PARLANTE&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;I. GOOGLE PYQUICK PYTHON VIDEO TUTORIALS DAY 1&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;There are three parts to &quot;Day 1&quot; of the Google PyQuick Python class by Nick Parlante. &quot;Part 1&quot; starts with an introduction to Python and explains strings. &quot;Part 2&quot; covers lists, sorting, and tuples. &quot;Part 3&quot; covers dictionaries and files.&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;b style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;Part 1: Introduction and Strings&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/tKTZoB2Vjuk?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Part 2: Lists, Sorting and Tuples&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/EPYupizJYQI?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: orange; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Part 3: Dictionaries and Files&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/haycL41dAhg?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://goo.gl/qi5jw&quot;&gt;Elcric Otto Circle&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* One */
google_ad_slot = &quot;8813220342&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Two */
google_ad_slot = &quot;8243854886&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Three */
google_ad_slot = &quot;7921082405&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://goo.gl/Hm4Lb&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt;  &lt;/span&gt;&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;g-plus&quot; data-action=&quot;share&quot; data-height=&quot;24&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;h1 style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;
How to Link to My Home Page&lt;/span&gt;&lt;/h1&gt;
&lt;form action=&quot;http://www.example.com/&quot;&gt;
&lt;label for=&quot;linkcode&quot;&gt;
To link to &quot;MY Home Page&quot; from your website, simply copy and paste the following code into your website HTML page:
&lt;/label&gt;
&lt;textarea cols=&quot;43&quot; id=&quot;linkcode&quot; onclick=&quot;this.focus();this.select();&quot; readonly=&quot;readonly&quot; rows=&quot;5&quot; title=&quot;Select the text here, click your right mouse button, click the Copy menu item, and paste it into your web page in HTML source mode&quot;&gt;&lt;p&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;&lt;/p&gt;
&lt;/textarea&gt;
&lt;/form&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;It will appear on your website as:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://pythonelcric.blogspot.com/2012/09/google-python-tutorials.html</link><author>noreply@blogger.com (Ron Tinnel)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s72-c/avatar.gif" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-960876793746149434.post-3424379558609878549</guid><pubDate>Fri, 31 Aug 2012 20:33:00 +0000</pubDate><atom:updated>2013-03-03T15:20:46.746-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">pyquick</category><category domain="http://www.blogger.com/atom/ns#">python file input</category><category domain="http://www.blogger.com/atom/ns#">Python file objects</category><category domain="http://www.blogger.com/atom/ns#">python file output</category><category domain="http://www.blogger.com/atom/ns#">Python I/O</category><title>PYTHON 3 FILE INPUT AND OUTPUT</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;title&gt;PYTHON 3 FILE INPUT AND OUTPUT&lt;/title&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;g-plusone&quot; data-annotation=&quot;inline&quot; data-width=&quot;300&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://www.elcricottocircle.blogspot.com/&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt;&lt;/span&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: xx-small;&quot;&gt;REVISED: Sunday, March 3, 2013&lt;/span&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: 800;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; imageanchor=&quot;1&quot; style=&quot;font-weight: bold; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;In this tutorial, you will learn how to save information to a file and read information from a file.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;I. USING THE PYTHON INTERPRETER SHELL&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;A. PYTHON FILE OUTPUT OBJECTS&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&quot;Double left mouse click&quot; the Python icon on your desktop to start the Python interpreter shell. &amp;nbsp;A Python interpreter shell window similar to the following will open:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;
Python 3.2.2 (default, Sep  4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)] on win
32
&lt;br /&gt;
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;After the Python interpreter shell &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; prompt the following syntax is used to create an instance of a class, called a &quot;file object&quot;, which we will name &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;outFile&lt;/span&gt;:&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;File object name&lt;/span&gt; &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;= open(&#39;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;file name&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;file type&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&#39;, &#39;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;modes&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&#39;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;For example:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;
Python 3.2.2 (default, Sep  4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)] on win
32
&lt;br /&gt;
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; outFile = open(&#39;output.txt&#39;, &#39;wt&#39;)
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The &quot;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;file object name&lt;/span&gt;&quot; is &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;outFile&lt;/span&gt;; which is assigned the &quot;file name&quot; by the method&amp;nbsp;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;open( )&lt;/span&gt;.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;The &quot;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;file name&lt;/span&gt;&quot; is &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;output&lt;/span&gt;.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The &quot;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;file type&lt;/span&gt;&quot; is &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;txt&lt;/span&gt;; and there has to be a period between the &quot;file name&quot; and the &quot;file type.&quot;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The &quot;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;modes&lt;/span&gt;&quot; are &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;wt&lt;/span&gt;; the &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;w&lt;/span&gt; is write mode, and the &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;t&lt;/span&gt; is writing in text mode.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;If the file&amp;nbsp;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;output.txt&lt;/span&gt; already exists in the default search directory it is opened; and if &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;output.txt&lt;/span&gt; does not exist it is created in your Python default hard drive folder.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;B. WRITING TO A FILE&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Continuing with our original example, the &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;write( )&lt;/span&gt; method is used to write to the file &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;output.txt&lt;/span&gt;:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;
Python 3.2.2 (default, Sep  4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)] on win
32
&lt;br /&gt;
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; outFile = open(&#39;output.txt&#39;, &#39;wt&#39;)
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; outFile.write(&quot;Hello, World!\nPython is fun!&quot;)
&lt;br /&gt;
28
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; outFile.close(&amp;nbsp;)
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;\n&lt;/span&gt; escape sequence is used as a carriage return to go to a new line.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The number &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;28&lt;/span&gt; is the number of characters used in the &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;outFile.write(&amp;nbsp;)&lt;/span&gt; method, including the &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;\n&lt;/span&gt; escape sequence. These numbers only appear when using the Python interpreter shell.  They do not appear when using a Python program. They are used by Python to keep track of where the Python character pointer is in the file. The Python character pointer is like an invisible cursor which moves along through a file as it is processed by Python.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;outFile.close(&amp;nbsp;)&lt;/span&gt;&amp;nbsp;method is used to close the &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;output.txt&lt;/span&gt; file when we have finished writing to the &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;output.txt&lt;/span&gt; file.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;C. PYTHON FILE INPUT OBJECTS&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;After the Python interpreter shell &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; prompt the following syntax is used to create an instance of a class, called a &quot;file object&quot;, which we will name &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;inFile&lt;/span&gt;:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;File object name&lt;/span&gt; &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;= open(&#39;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;file name&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;file type&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&#39;, &#39;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;modes&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&#39;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Continuing with our original example:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;
Python 3.2.2 (default, Sep  4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)] on win
32
&lt;br /&gt;
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; outFile = open(&#39;output.txt&#39;, &#39;wt&#39;)
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; outFile.write(&quot;Hello, World!\nPython is fun!&quot;)
&lt;br /&gt;
28
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; outFile.close(&amp;nbsp;)

&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; inFile = open(&#39;output.txt&#39;, &#39;rt&#39;)
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The &quot;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;file object name&lt;/span&gt;&quot; is &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;inFile&lt;/span&gt;; which is assigned the &quot;file name&quot; by the method&amp;nbsp;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;open( )&lt;/span&gt;.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;The &quot;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;file name&lt;/span&gt;&quot; is &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;output&lt;/span&gt;.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The &quot;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;file type&lt;/span&gt;&quot; is &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;txt&lt;/span&gt;; and there has to be a period between the &quot;file name&quot; and the &quot;file type.&quot;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The &quot;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;modes&lt;/span&gt;&quot; are &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;rt&lt;/span&gt;; the &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;r&lt;/span&gt; is read mode, and the &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;t&lt;/span&gt; is reading in text mode.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;If the file&amp;nbsp;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;output.txt&lt;/span&gt; already exists it is opened; and if &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;output.txt&lt;/span&gt; does not exist Python generates an error message.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;D. READING FROM A FILE&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Continuing with our original example:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;
Python 3.2.2 (default, Sep  4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)] on win
32
&lt;br /&gt;
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; outFile = open(&#39;output.txt&#39;, &#39;wt&#39;)
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; outFile.write(&quot;Hello, World!\nPython is fun!&quot;)
&lt;br /&gt;
28
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; outFile.close(&amp;nbsp;)

&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; inFile = open(&#39;output.txt&#39;, &#39;rt&#39;)
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; inFile.read(&amp;nbsp;)
&lt;br /&gt;
&#39;Hello, World!\nPython is fun!&#39;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;As shown above the method&amp;nbsp;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;inFile.read(&amp;nbsp;)&lt;/span&gt; is used to read the file &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;output.txt&lt;/span&gt;.  However, it is not printed in a user friendly format.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;Continuing with our original example:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;
Python 3.2.2 (default, Sep  4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)] on win
32
&lt;br /&gt;
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; outFile = open(&#39;output.txt&#39;, &#39;wt&#39;)
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; outFile.write(&quot;Hello, World!\nPython is fun!&quot;)
&lt;br /&gt;
28
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; outFile.close(&amp;nbsp;)

&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; inFile = open(&#39;output.txt&#39;, &#39;rt&#39;)
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; inFile.read(&amp;nbsp;)
&lt;br /&gt;
&#39;Hello, World!\nPython is fun!&#39;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; inFile.close(&amp;nbsp;)
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; inFile = open(&#39;output.txt&#39;, &#39;rt&#39;)
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; text = inFile.read(&amp;nbsp;)
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; print(text)
&lt;br /&gt;
Hello, World!&lt;br /&gt;Python is fun!&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; inFile.close(&amp;nbsp;)
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; quit(&amp;nbsp;)
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;As shown above, the file object &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;inFile&lt;/span&gt; was closed and reopened, this was done to move the Python invisible cursor back to the beginning of the file. This had to be done because &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;inFile.read(&amp;nbsp;)&lt;/span&gt;&amp;nbsp;method had moved the cursor to the end of the file. Next, &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;text&lt;/span&gt; was assigned &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;inFile.read(&amp;nbsp;)&lt;/span&gt; and the method &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;print(text)&lt;/span&gt; was used to print the file in a more user friendly fashion. The &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;inFile.close( )&lt;/span&gt; method was used to close the &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;output.txt&lt;/span&gt; file. And, last of all, the &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;quit(&amp;nbsp;)&lt;/span&gt; method was &quot;called&quot; to exit from the Python interpreter shell.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;II. WRITING YOUR FIRST PYTHON PROGRAM&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;A Python program is just a text file that you edit directly. You can use any text editor with an understanding of code and endentation; e.g., Notepad++, to create a Python program, also called a module or script. &amp;nbsp;For example, open your favorite text editor and then copy the following example and paste it into your text editor:&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;# My first Python program!&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;outFile = open(&#39;output.txt&#39;, &#39;wt&#39;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;outFile.write(&quot;Hello, World!\nPython is fun!&quot;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;outFile.close( )&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;inFile = open(&#39;output.txt&#39;, &#39;rt&#39;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;text = inFile.read( )&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;print(text)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;inFile.close( )&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;From your text editor, do a &quot;File Save As&quot; and save the above Python program example, using the file name&lt;/b&gt; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;fun1.py&lt;/b&gt;&lt;/span&gt; &lt;b&gt;to the same path which your computer used to download Python. For example, using my text editor I saved my&lt;/b&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: purple; font-family: Verdana, sans-serif; font-weight: bold;&quot;&gt;fun1.py&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt; &lt;b&gt;file to my&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;Python32 folder using the following path:&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;C:\Python32\&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;fun1.py&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Congratulations, you have just written your first Python program!&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;III. READING YOUR FIRST PYTHON PROGRAM&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;A Python program is a Python file containing Python definitions and statements. The Python program we created above contains the Python method&lt;/b&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;print( )&lt;/b&gt;&lt;/span&gt; &lt;b&gt;which will cause Python to display printed output&amp;nbsp;onto your computer screen. &amp;nbsp;The &quot;file name&quot; is the Python program name with the suffix&lt;/b&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;.py&lt;/b&gt;&lt;/span&gt; &lt;b&gt;appended; for example:&lt;/b&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;fun1.py&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;From your desktop &quot;double left mouse click&quot; the Python icon and the Python interpreter shell window will open. From the Python interpreter shell window &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; Python prompt, type &lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;import&lt;/b&gt;&lt;/span&gt;&lt;b&gt;, followed by the file name&lt;/b&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;fun1&lt;/b&gt;&lt;/span&gt;&lt;b&gt;, and then press&lt;/b&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Enter&lt;/b&gt;&lt;/span&gt;&lt;b&gt; and the &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;fun1&lt;/span&gt; module will be executed during import, as shown below:&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;import&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;fun1&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;Hello, World!&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;Python is fun!&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;span style=&quot;color: purple;&quot;&gt;quit( )&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Comments are like notes you embed in your program to help you remember why you coded the program the way you did. As shown above, Python does not print your comments. A comment in Python starts with a pound sign, &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;#&lt;/span&gt;, also called a hash character;&lt;/b&gt;&lt;b&gt;&amp;nbsp;and the comment extends to the end of the &amp;nbsp;line.&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;To exit the Python shell, call the &lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;quit( )&lt;/span&gt; method by typing:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;quit( )&lt;/span&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;and then pressing&lt;/b&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Enter&lt;/b&gt;&lt;/span&gt;&lt;b&gt;.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;In this tutorial, you have learned how to save information to a file and read information from a file.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://goo.gl/qi5jw&quot;&gt;Elcric Otto Circle&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* One */
google_ad_slot = &quot;8813220342&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Two */
google_ad_slot = &quot;8243854886&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Three */
google_ad_slot = &quot;7921082405&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://goo.gl/Hm4Lb&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt;  &lt;/span&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;g-plus&quot; data-action=&quot;share&quot; data-height=&quot;24&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;h1 style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;
How to Link to My Home Page&lt;/span&gt;&lt;/h1&gt;
&lt;form action=&quot;http://www.example.com/&quot;&gt;
&lt;label for=&quot;linkcode&quot;&gt;
To link to &quot;MY Home Page&quot; from your website, simply copy and paste the following code into your website HTML page:
&lt;/label&gt;
&lt;textarea cols=&quot;43&quot; id=&quot;linkcode&quot; onclick=&quot;this.focus();this.select();&quot; readonly=&quot;readonly&quot; rows=&quot;5&quot; title=&quot;Select the text here, click your right mouse button, click the Copy menu item, and paste it into your web page in HTML source mode&quot;&gt;&lt;p&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;&lt;/p&gt;
&lt;/textarea&gt;
&lt;/form&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;It will appear on your website as:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://pythonelcric.blogspot.com/2012/08/python-index.html</link><author>noreply@blogger.com (Ron Tinnel)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s72-c/avatar.gif" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-960876793746149434.post-4343471440003499586</guid><pubDate>Tue, 25 Oct 2011 14:14:00 +0000</pubDate><atom:updated>2015-02-05T05:57:00.944-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">downloading Python</category><category domain="http://www.blogger.com/atom/ns#">Google Python tutorials</category><category domain="http://www.blogger.com/atom/ns#">pyquick</category><category domain="http://www.blogger.com/atom/ns#">Python</category><category domain="http://www.blogger.com/atom/ns#">reading first Python program</category><category domain="http://www.blogger.com/atom/ns#">writing first Python program</category><title>DOWNLOADING AND INSTALLING, PYTHON 3.4.2</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;title&gt;DOWNLOADING AND INSTALLING, PYTHON 3.2.2&lt;/title&gt;
&lt;br /&gt;
&lt;div class=&quot;g-plusone&quot; data-annotation=&quot;inline&quot; data-width=&quot;300&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://www.elcricottocircle.blogspot.com/&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt;&lt;/span&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: xx-small;&quot;&gt;REVISED: Thursday, Febuary 5, 2015&lt;/span&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: 800;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; imageanchor=&quot;1&quot; style=&quot;font-weight: bold; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s1600/avatar.gif&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;In this tutorial, you will learn how to download &amp;nbsp;and install, Python 3.4.2.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;I. &amp;nbsp;PYTHON INTRODUCTION&lt;/b&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Python is free to use; even for commercial products!&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Python was created in the early 1990s by Guido van Rossum at the National Research Institute for Mathematics and Computer Science in Netherlands. Python’s elegant syntax and dynamic typing, make it an ideal language for scripting and rapid application development.  Python is an interpreted language, which can save you considerable time during program development because no compilation and linking are necessary.&amp;nbsp;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Tkinter&quot; title=&quot;Tkinter&quot;&gt;Tkinter&lt;/a&gt;,&amp;nbsp;a &quot;graphical user interface&quot; (GUI), is bundled with Python. The name Python was selected from &quot;Monty Python’s Flying Circus&quot; which was a British sketch comedy series created by the comedy group Monty Python and broadcast by the BBC from 1969 to 1974.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;II.  DOWNLOADING AND INSTALLING PYTHON&lt;/b&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;To download Python click on the following link:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&lt;a href=&quot;https://www.python.org/&quot;&gt;PYTHON&lt;/a&gt;.&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Select the appropriate download for your computer; and during the download, select the option which places a Python icon on your desktop. You will then be able to &quot;double left mouse click&quot; the Python icon as a shortcut when you want to start the Python interpreter shell.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;My computer uses Microsoft Windows; therefore, I used the &quot;Windows Installer&quot; for Python 3.4.2 and my Python download was to the following default hard drive path folder:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;C:\Python34\&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;If necessary, check your hard drive and write down and remember the hard drive default path folder your computer used for your Python download. &amp;nbsp;You will need to know this default information when you are writing and reading Python files.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;III. &amp;nbsp;PYTHON DOWNLOAD AND INSTALLATION VALIDATION&lt;/b&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;
&quot;Double left mouse click&quot; the Python icon on your desktop to start the Python interpreter shell.  A Python interpreter shell window will open, as shown below:&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Python 3.4.2 (v3.4.2:ab2c023a9432, Oct &amp;nbsp;6 2014, 22:15:05) [MSC v.1600 32 bit (Intel)] on win32&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Type &quot;copyright&quot;, &quot;credits&quot; or &quot;license()&quot; for more information.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;
&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;When you see the above message, you have successfully downloaded and installed Python.&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;IV. &amp;nbsp;TKINTER&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;When the &quot;Python 3.4.2 Shell&quot; window opens, as shown in part &lt;span style=&quot;color: red;&quot;&gt;III.&lt;/span&gt; above, &amp;nbsp;select &quot;&lt;span style=&quot;color: magenta;&quot;&gt;File&lt;/span&gt;&quot;, then select &quot;&lt;span style=&quot;color: magenta;&quot;&gt;New File&lt;/span&gt;&quot; and an &quot;&lt;span style=&quot;color: magenta;&quot;&gt;Untitled&lt;/span&gt;&quot; window opens. &lt;span style=&quot;color: magenta;&quot;&gt;Copy&lt;/span&gt; and then &lt;span style=&quot;color: magenta;&quot;&gt;paste&lt;/span&gt; the following into the &quot;&lt;span style=&quot;color: magenta;&quot;&gt;Untitled&lt;/span&gt;&quot; window:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;import tkinter&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;import turtle&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;def main():&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; root = tkinter.Tk()&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;root.title(&quot;Hello, World!&quot;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; tkinter.mainloop()&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;if __name__ == &#39;__main__&#39;:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; main()&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;From the &quot;&lt;span style=&quot;color: magenta;&quot;&gt;Untitled&lt;/span&gt;&quot; window, do a &quot;&lt;span style=&quot;color: magenta;&quot;&gt;File Save As&lt;/span&gt;&quot; and save the above Python program, using the file name &lt;span style=&quot;color: magenta;&quot;&gt;tkinterValidation.py&lt;/span&gt; to the same path which your computer used to download Python 3.4.2. For example, I saved my &lt;span style=&quot;color: magenta;&quot;&gt;tkinterValidation.py&lt;/span&gt; file to my Python34 folder using the path &lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;C:\Python34\tkinterValidation.py&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;From the &quot;&lt;span style=&quot;color: magenta;&quot;&gt;Untitled&lt;/span&gt;&quot; window, do a &quot;&lt;span style=&quot;color: magenta;&quot;&gt;Run Module F5&lt;/span&gt;&quot; and a &quot;blank frame&quot;, also called a &quot;blank window&quot;,  should open. If you have a &quot;blank frame&quot; with the title &quot;Hello, World!&quot; at the top, you have verified Tkinter is working, and you are ready to use the Tkinter GUI.
&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta; font-family: Verdana, sans-serif;&quot;&gt;
&lt;b&gt;In this tutorial, you have learned how to download and install, Python 3.4.2.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://goo.gl/qi5jw&quot;&gt;Elcric Otto Circle&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* One */
google_ad_slot = &quot;8813220342&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;

--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Two */
google_ad_slot = &quot;8243854886&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-4871588942132101&quot;;
/* Three */
google_ad_slot = &quot;7921082405&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;g-plus&quot; data-action=&quot;share&quot; data-height=&quot;24&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://apis.google.com/js/plusone.js&#39;;
    var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(po, s);
  })();
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;form&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;input onclick=&quot;window.location.href=&#39;http://goo.gl/Hm4Lb&#39;&quot; type=&quot;BUTTON&quot; value=&quot;HOME PAGE&quot; /&gt;  &lt;/span&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;h1 style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;
How to Link to My Home Page&lt;/span&gt;&lt;/h1&gt;
&lt;form action=&quot;http://www.example.com/&quot;&gt;
&lt;label for=&quot;linkcode&quot;&gt;
To link to &quot;MY Home Page&quot; from your website, simply copy and paste the following code into your website HTML page:
&lt;/label&gt;
&lt;textarea cols=&quot;43&quot; id=&quot;linkcode&quot; onclick=&quot;this.focus();this.select();&quot; readonly=&quot;readonly&quot; rows=&quot;5&quot; title=&quot;Select the text here, click your right mouse button, click the Copy menu item, and paste it into your web page in HTML source mode&quot;&gt;&lt;p&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;&lt;/p&gt;
&lt;/textarea&gt;
&lt;/form&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;It will appear on your website as:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;a href=&quot;http://goo.gl/Hm4Lb&quot; target=&quot;_top&quot;&gt;&quot;Link to: ELCRIC OTTO CIRCLE&#39;s Home Page&quot;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://pythonelcric.blogspot.com/2011/10/introduction-to-python.html</link><author>noreply@blogger.com (Ron Tinnel)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-o8yJseVH9LPxNYJyvOrWO-VSzdMgEDE2nhihtgc-haFEpgvpdMIrM2du-hdKa6P-ED6EBEtieDtTGyILbgb_hLWaTB6ei6MZTO3pW2INb1zKPYSSqsvLij1dL1IIzvqIAcfVbd_1O4/s72-c/avatar.gif" height="72" width="72"/><thr:total>0</thr:total></item></channel></rss>