<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='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'><id>tag:blogger.com,1999:blog-946847870710349072</id><updated>2026-07-01T23:48:43.298+09:30</updated><category term="python"/><category term="basics"/><title type='text'>everythingPython</title><subtitle type='html'>Everything Python. All the time.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://everythingpython.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://everythingpython.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>everythingpython</name><uri>http://www.blogger.com/profile/14468235809833874593</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-946847870710349072.post-1725832167168580036</id><published>2011-05-25T13:00:00.002+09:30</published><updated>2011-05-25T13:13:59.201+09:30</updated><title type='text'>Repetition Structures</title><content type='html'>Coming Soon!</content><link rel='replies' type='application/atom+xml' href='http://everythingpython.blogspot.com/feeds/1725832167168580036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://everythingpython.blogspot.com/2011/05/repetition-structures.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/1725832167168580036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/1725832167168580036'/><link rel='alternate' type='text/html' href='http://everythingpython.blogspot.com/2011/05/repetition-structures.html' title='Repetition Structures'/><author><name>everythingpython</name><uri>http://www.blogger.com/profile/14468235809833874593</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-946847870710349072.post-3527281497617616683</id><published>2011-05-25T11:13:00.005+09:30</published><updated>2011-05-25T13:08:35.020+09:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="basics"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Selection Structures</title><content type='html'>Selection structures are used to make decisions that allow us to control the path of execution.&lt;br /&gt;
This lesson covers the &lt;b&gt;if&lt;/b&gt; selection structure.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
A simple &lt;b&gt;if&lt;/b&gt; statement has the following form&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;if &lt;i&gt;expression:&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &lt;/i&gt;&lt;/b&gt;&lt;i&gt;true_suite&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #6aa84f;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;If the expression is True, the statements indented under the if statement are executed. If the expression is False the program jumps to the next statement after the indented block.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;It is important to use consistent indentation. Python uses indentation to signify its block structure.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The &lt;b&gt;else&lt;/b&gt; structure allows us to execute one set of statements if the expression is true, and another if the expression is false. It has the following form:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;if &lt;i&gt;expression:&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &lt;/i&gt;&lt;/b&gt;&lt;i&gt;true_suite&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;else:&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;color: #6aa84f;&quot;&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; false_suite&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Example:&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: #6aa84f; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #6aa84f; text-align: left;&quot;&gt;if age &amp;gt;= 18:&lt;/div&gt;&lt;div style=&quot;color: #6aa84f; text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&#39;You can vote!&#39;)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;color: #6aa84f; text-align: left;&quot;&gt;else:&lt;/div&gt;&lt;div style=&quot;color: #6aa84f; text-align: left;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;Sorry, you can&#39;t vote yet!&#39;)&lt;/div&gt;&lt;div style=&quot;color: #6aa84f; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
The above example will display &lt;b&gt;You can vote! &lt;/b&gt;if the variable, &lt;b&gt;age, &lt;/b&gt;is equal to or greater than 18, &lt;b&gt;else&lt;/b&gt;, it will display &lt;b&gt;Sorry, you can&#39;t vote yet!&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
The &lt;b&gt;elif&lt;/b&gt; structure is used to check multiple criteria while keeping your code easy to read.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;if &lt;/b&gt;mark &amp;gt;= 85:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;HD&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;elif &lt;/b&gt;mark &amp;gt;= 75:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;D&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;elif &lt;/b&gt;mark &amp;gt;= 65:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;C&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;elif &lt;/b&gt;mark &amp;gt;= 55:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;P1&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;elif &lt;/b&gt;mark &amp;gt;= 50:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;P2&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;elif &lt;/b&gt;mark &amp;gt;= 40:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;F1&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;else&lt;/b&gt;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;F2&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Looking back on the &lt;a href=&quot;http://everythingpython.blogspot.com/2011/05/exercises-part-2.html&quot;&gt;previous exercise&lt;/a&gt; to create a program that generates a random number, we are going to modify it to ask the user to guess the random number, and if the user guesses it correctly, display &quot;Well done - you guessed it!&quot;. If the guess is too low, display &#39;Too Low&#39;, or if it is too high, display &#39;Too High&#39;. &lt;br /&gt;
&lt;br /&gt;
The solution to this program can be found below, but try to do the work yourself first before looking.&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;spoiler&quot; style=&quot;display: none;&quot;&gt;&lt;div style=&quot;color: #6aa84f; text-align: left;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;# Import the random library&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #6aa84f; text-align: left;&quot;&gt;import random&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;# Generate a random number&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #6aa84f; text-align: left;&quot;&gt;number = random.randint(1, 10)&lt;/div&gt;&lt;br style=&quot;color: red;&quot; /&gt;&lt;span style=&quot;color: red;&quot;&gt;# Get input from the user and print their guess&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #6aa84f; text-align: left;&quot;&gt;guess = int(input(&#39;Please enter your guess: &#39;))&lt;br /&gt;
print(&#39;You guessed:&#39;, guess)&lt;/div&gt;&lt;div style=&quot;color: #6aa84f; text-align: left;&quot;&gt;&lt;br style=&quot;color: red;&quot; /&gt;&lt;span style=&quot;color: red;&quot;&gt;# Check whether the user guessed correctly&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;# And let them know if they guessed too high or too low &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #6aa84f; text-align: left;&quot;&gt;if number == guess:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;Well done - you guessed it!&#39;)&lt;br /&gt;
elif guess &amp;lt; number:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;Too Low&#39;)&lt;br /&gt;
elif guess &amp;gt; number:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;Too High&#39;)&lt;/div&gt;&lt;div style=&quot;color: #6aa84f; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;button onclick=&quot;if(document.getElementById(&#39;spoiler&#39;)
.style.display==&#39;none&#39;) {document.getElementById(&#39;spoiler&#39;)
.style.display=&#39;&#39;}else{document.getElementById(&#39;spoiler&#39;)
.style.display=&#39;none&#39;}&quot; title=&quot;Click to show/hide content&quot; type=&quot;button&quot;&gt;Show Code&lt;/button&gt; &lt;br /&gt;
&lt;br /&gt;
Okay, so once you have that covered and are confident with the structures we will look at combining comparisons using a couple of examples.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;and &lt;/b&gt;operator - true only if temperature is greater than zero &lt;b&gt;and&lt;/b&gt; less than 40:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;if&lt;/b&gt; temperature &amp;gt; 0 &lt;b&gt;and &lt;/b&gt;temperature &amp;lt; 40:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp; &amp;nbsp; print(&#39;Normal Temperature&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;else&lt;/b&gt;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;Extreme Temperature&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;or &lt;/b&gt;operator - true if either of the conditions are true, eg. if it is raining or highUV&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;raining = True&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;highUV = True&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;if &lt;/b&gt;raining &lt;b&gt;or &lt;/b&gt;highUV:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;Take an umbrella!&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If you are having any problems so far, read through again, look at the code, and just play around with different variables and values until you understand how the structures and output works. You can always post a comment and ask for help if you need it, I&#39;m happy to help!&lt;br /&gt;
&lt;br /&gt;
Continue on to: &lt;a href=&quot;http://everythingpython.blogspot.com/2011/05/repetition-structures.html&quot;&gt;Repetition Structures&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
-Nathan (everythingPython)</content><link rel='replies' type='application/atom+xml' href='http://everythingpython.blogspot.com/feeds/3527281497617616683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://everythingpython.blogspot.com/2011/05/selection-structures.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/3527281497617616683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/3527281497617616683'/><link rel='alternate' type='text/html' href='http://everythingpython.blogspot.com/2011/05/selection-structures.html' title='Selection Structures'/><author><name>everythingpython</name><uri>http://www.blogger.com/profile/14468235809833874593</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-946847870710349072.post-3725785906980244865</id><published>2011-05-25T11:12:00.002+09:30</published><updated>2011-05-25T11:15:31.080+09:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="basics"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Comparison and Boolean Operators</title><content type='html'>In this next lesson we will discuss Comparison operators and Boolean operators.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Comparison Operators&lt;/b&gt; are used to compare the values of two objects.&lt;br /&gt;
&lt;b&gt;Boolean Operators&lt;/b&gt; allow us to combine comparisons.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;1&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;td&gt;&lt;b&gt;Operator&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&amp;nbsp;==&lt;br /&gt;
&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;is equal to&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;!=&lt;/td&gt; &lt;td&gt;is not equal to&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&amp;lt;&lt;/td&gt; &lt;td&gt;is less than&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&amp;lt;=&lt;/td&gt; &lt;td&gt;is less than or equal to&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&amp;gt;&lt;/td&gt; &lt;td&gt;is greater than&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&amp;gt;=&lt;/td&gt; &lt;td&gt;is greater than or equal to&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;&lt;br /&gt;
Using the above operators we are able to make decisions based on the outcome of the comparison.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Example&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; a = 5&lt;/div&gt;&lt;div style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/b&gt;b = 2&lt;/div&gt;&lt;div style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; a &amp;lt; b&lt;/div&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;False&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The result of the comparison will either be &lt;b&gt;True &lt;/b&gt;or &lt;b&gt;False&lt;/b&gt;, depending on the values being compared.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Boolean Operators&lt;/b&gt; (and, or, not) are used to combine comparisons. These can be used when either one, both, or two or more conditions need to be met.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Example&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: #6aa84f;&quot;&gt;IF (today is monday and payday is monday) THEN&lt;/div&gt;&lt;div style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cash check&lt;/div&gt;&lt;br /&gt;
The above example will only return a result if both the current day is Monday, and the payday variable is Monday.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Example&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: #6aa84f;&quot;&gt;IF (x &amp;gt;= 0 &lt;b&gt;and &lt;/b&gt;x &amp;lt;= 5) THEN&lt;/div&gt;&lt;div style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINT x is between 0 and 5 (inclusive)&lt;/div&gt;&lt;div style=&quot;color: #6aa84f;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #6aa84f;&quot;&gt;IF (x &amp;lt;= 2 &lt;b&gt;or &lt;/b&gt;x &amp;gt;= 4) THEN&lt;/div&gt;&lt;div style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINT x is less than or equal to 2, or greater than or equal to 4&lt;/div&gt;&lt;div style=&quot;color: #6aa84f;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;not &lt;/b&gt;a == b and c == d&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first example will only execute if &lt;b&gt;x&lt;/b&gt; is both greater than or equal to 0 &lt;b&gt;and&lt;/b&gt; less than or equal to 5. Meaning that &lt;b&gt;x&lt;/b&gt; must be either the value&lt;b&gt; 0, 1, 2, 3, 4 or 5&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
The second example will execute if either &lt;b&gt;x&lt;/b&gt; is equal to or less than 2 &lt;b&gt;or &lt;/b&gt;if &lt;b&gt;x&lt;/b&gt; is greater than or equal to 4. This means that if x is any value &lt;b&gt;except &lt;/b&gt;3, it will execute as the value 3 is neither &amp;lt;= 2 or &amp;gt;= 4.&lt;br /&gt;
&lt;br /&gt;
The third example uses the &lt;b&gt;not&lt;/b&gt; operator which negates the value of the operand, converting &lt;b&gt;True &lt;/b&gt;to &lt;b&gt;False &lt;/b&gt;and &lt;b&gt;False &lt;/b&gt;to &lt;b&gt;True&lt;/b&gt;. This means that if &lt;b&gt;a&lt;/b&gt; is not equal to &lt;b&gt;b&lt;/b&gt; and &lt;b&gt;c&lt;/b&gt; is equal to &lt;b&gt;d&lt;/b&gt; then it will return &lt;b&gt;True&lt;/b&gt;. A more expanded example is shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; a = 5&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; b = 3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; c = 6&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; d = 6&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; a == b&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;False&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; c == d&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;True&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; not a == b&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;True&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; not c == d&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;False&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; not a == b and c == d&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;True&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
As you can see from above:&lt;br /&gt;
&lt;b&gt;a &lt;/b&gt;and &lt;b&gt;b&lt;/b&gt; are not equal, thus when compared it returns &lt;b&gt;False&lt;/b&gt;.&lt;br /&gt;
&lt;b&gt;c&lt;/b&gt; and &lt;b&gt;d &lt;/b&gt;are equal, and thus when compared they return &lt;b&gt;True&lt;/b&gt;. &lt;br /&gt;
using &lt;b&gt;not a == b&lt;/b&gt; returns &lt;b&gt;True &lt;/b&gt;when compared because it is evaluating it as: &lt;b&gt;a &lt;/b&gt;is not equal to &lt;b&gt;b&lt;/b&gt;, which is true.&lt;br /&gt;
Hence when using &lt;b&gt;not a == b and c == d, &lt;/b&gt;the return is &lt;b&gt;True&lt;/b&gt; because &lt;b&gt;a is not equal to be and c is equal to d.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This can be a bit hard to get a grasp of at first, and if you need to, play around with variables and values and see how it works when you use the &lt;b&gt;not&lt;/b&gt; operator. You will get the hang of it soon.&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;Once you have completed this section, move on to the next: &lt;a href=&quot;http://everythingpython.blogspot.com/2011/05/selection-structures.html&quot;&gt;Selection Structures&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
-Nathan (everythingPython)</content><link rel='replies' type='application/atom+xml' href='http://everythingpython.blogspot.com/feeds/3725785906980244865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://everythingpython.blogspot.com/2011/05/comparison-and-boolean-operators.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/3725785906980244865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/3725785906980244865'/><link rel='alternate' type='text/html' href='http://everythingpython.blogspot.com/2011/05/comparison-and-boolean-operators.html' title='Comparison and Boolean Operators'/><author><name>everythingpython</name><uri>http://www.blogger.com/profile/14468235809833874593</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-946847870710349072.post-1546626223620865198</id><published>2011-05-24T10:59:00.002+09:30</published><updated>2011-05-25T11:14:06.456+09:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="basics"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Exercises Part 2</title><content type='html'>Going back to your files from &lt;a href=&quot;http://everythingpython.blogspot.com/2011/05/exercises-part-1.html&quot;&gt;Exercises Part 1&lt;/a&gt;, we are going to be modifying them to allow user input.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Modify the first program to allow the user to enter a width and height. The area should be displayed on the screen as: &lt;b&gt;The area is: x&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Modify the second program to allow the user to enter a length. The result should be displayed on the screen as: &lt;b&gt;The length is: x &lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Write a program to generate a &lt;a href=&quot;http://docs.python.org/py3k/library/random.html&quot;&gt;random &lt;/a&gt;number between 1-10 and display the number on the screen as: &lt;b&gt;Random number is: x&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Once done with the above program, modify it to ask the user to guess the number, and display their guess on the screen.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;*REMEMBER*&lt;/b&gt; You need to &lt;b&gt;import &lt;/b&gt;the appropriate libraries when needed. &lt;/li&gt;
&lt;/ul&gt;You can view the above random guessing program below. It is best to try it yourself first, and use this to check your code.&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;spoiler&quot; style=&quot;display: none;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;# Import the random library&lt;/span&gt;&lt;br /&gt;
import random&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;# Generate a random number from 1 to 10,&lt;br /&gt;
# and assign it to the variable random&lt;/span&gt;&lt;br /&gt;
random = random.randint(1, 10)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;# Ask the user for their guess&lt;/span&gt;&lt;br /&gt;
guess = int(input(&quot;Guess the random number: &quot;))&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;# Display the user guess and random number&lt;/span&gt;&lt;br /&gt;
print(&quot;You guessed:&quot;, guess, &quot;\nRandom number is:&quot;, random)&lt;/div&gt;&lt;button onclick=&quot;if(document.getElementById(&#39;spoiler&#39;)
.style.display==&#39;none&#39;) {document.getElementById(&#39;spoiler&#39;)
.style.display=&#39;&#39;}else{document.getElementById(&#39;spoiler&#39;)
.style.display=&#39;none&#39;}&quot; title=&quot;Click to show/hide content&quot; type=&quot;button&quot;&gt;Show Code&lt;/button&gt;&lt;br /&gt;
&lt;br /&gt;
Once you have completed the above exercises you are ready to move on to the next lesson: &lt;a href=&quot;http://everythingpython.blogspot.com/2011/05/comparison-and-boolean-operators.html&quot;&gt;Comparison and Boolean Operators&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
-Nathan (everythingPython)</content><link rel='replies' type='application/atom+xml' href='http://everythingpython.blogspot.com/feeds/1546626223620865198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://everythingpython.blogspot.com/2011/05/exercises-part-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/1546626223620865198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/1546626223620865198'/><link rel='alternate' type='text/html' href='http://everythingpython.blogspot.com/2011/05/exercises-part-2.html' title='Exercises Part 2'/><author><name>everythingpython</name><uri>http://www.blogger.com/profile/14468235809833874593</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-946847870710349072.post-3570039244844176337</id><published>2011-05-24T10:50:00.002+09:30</published><updated>2011-05-25T13:11:22.838+09:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="basics"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>User-Controlled Input and Output</title><content type='html'>Continuing from the last lesson we will look further into creating more general programs that allow the user to input values while the program is running, using the input() function.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;value = input(&#39;Enter a value: &#39;)&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;The above code displays the following string and waits for the user to provide input.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt; &lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Enter a value:&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;The value entered is then referenced by the variable &lt;b&gt;value&lt;/b&gt;. Eg.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #6aa84f; text-align: left;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; value = input(&#39;Enter a value: &#39;)&lt;br /&gt;
&lt;b&gt;Enter a value: 13&lt;/b&gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; value&lt;br /&gt;
&lt;b&gt;&#39;13&#39;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;In this case, the input function returns a string. This may need to be converted to an integer or floating-point value. We can do this using either of the following methods.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #6aa84f; text-align: left;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; value = int(input(&#39;Enter a value: &#39;))&lt;br /&gt;
&lt;b&gt;Enter a value: 13&lt;/b&gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; value&lt;br /&gt;
&lt;b&gt;13&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; value = float(input(&#39;Enter a value: &#39;))&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #6aa84f;&quot;&gt;Enter a value: 13&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; value&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #6aa84f;&quot;&gt;13.0&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;The &lt;b&gt;int()&lt;/b&gt; and &lt;b&gt;float()&lt;/b&gt; functions take the user input, and convert it to the appropriate type.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Below is another example, this time with strings. It take the user input for the first and last name, adds them together in the variable &lt;b&gt;name&lt;/b&gt; and places a space between them. The name is then output directly and via the &lt;b&gt;print()&lt;/b&gt; function.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; first = input(&#39;Enter your first name: &#39;)&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #6aa84f;&quot;&gt;Enter your first name: Peter&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; last = input(&#39;Enter your last name: &#39;)&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #6aa84f;&quot;&gt;Enter your last name: Griffin&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; name = first + &#39; &#39; + last&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; name&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #6aa84f;&quot;&gt;&#39;Peter Griffin&#39;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; print(name)&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #6aa84f;&quot;&gt;Peter Griffin&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Once you feel confident working with these functions, continue on to: &lt;a href=&quot;http://everythingpython.blogspot.com/2011/05/exercises-part-2.html&quot;&gt;Exercises Part 2&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;-Nathan (everythingPython)&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://everythingpython.blogspot.com/feeds/3570039244844176337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://everythingpython.blogspot.com/2011/05/user-controlled-input-and-output.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/3570039244844176337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/3570039244844176337'/><link rel='alternate' type='text/html' href='http://everythingpython.blogspot.com/2011/05/user-controlled-input-and-output.html' title='User-Controlled Input and Output'/><author><name>everythingpython</name><uri>http://www.blogger.com/profile/14468235809833874593</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-946847870710349072.post-8741435636895016241</id><published>2011-05-24T10:13:00.002+09:30</published><updated>2011-05-25T13:11:50.278+09:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="basics"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Built-in Functions</title><content type='html'>The Python interpreter has a number of functions that are always available for use, meaning you do not have to import any libraries. This lesson will cover a few of the built-in functions.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
A function consists of three components: &lt;b&gt;Name, Input Argument(s) and Output.&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
An example function would be &lt;b&gt;a = abs(x)&lt;/b&gt;, which is shown (exploded) below.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Output&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Input Argument&lt;/i&gt;&lt;br /&gt;
&lt;b&gt;a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp;&amp;nbsp;&amp;nbsp; abs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/b&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The input argument is placed inside of the parentheses, and the output is the value that is returned by the function. There are functions that will require multiple inputs to work, such as the &lt;b&gt;pow&lt;/b&gt; function which returns &lt;i&gt;x&lt;/i&gt; to the power of &lt;i&gt;y&lt;/i&gt;. Eg:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;pow&lt;/b&gt;(&lt;i&gt;x, y&lt;/i&gt;)&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;pow&lt;/b&gt;(&lt;i&gt;5, 2&lt;/i&gt;)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;5 to the power of 2 = 25&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Using the example above, you can assign a variable (name) to the output:&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;result = power(5, 2)&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Below is a list of some of the Built-in functions that you may find useful when starting out:&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;1&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;td&gt;&lt;b&gt;Function&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;abs(x)&lt;/td&gt; &lt;td&gt;Returns the absolute value of x.&lt;/td&gt; &lt;td&gt;ans = abs(-3) ans = 3&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;pow(x, y)&lt;/td&gt; &lt;td&gt;Returns x to the power of y.&lt;/td&gt; &lt;td&gt;ans = pow(5, 2) ans = 25&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;round(x[, n])&lt;/td&gt; &lt;td&gt;Returns the floating point value x rounded to n digits after the decimal point. If n is omitted, it defaults to zero.&lt;/td&gt; &lt;td&gt;ans = round(1.6) ans = 2&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;int([number|string[, base]])&lt;/td&gt; &lt;td&gt;Converts a number or string to an integer. If no arguments are given, returns 0.&lt;/td&gt; &lt;td&gt;ans = int(&#39;7&#39;)&amp;nbsp;&amp;nbsp; ans = 7&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;float([x])&lt;/td&gt; &lt;td&gt;Converts a string or number to a floating point.&lt;/td&gt; &lt;td&gt;ans = float(&#39;1.5&#39;) ans = 1.5&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;range([start], stop[, step])&lt;/td&gt; &lt;td&gt;Constructs progression of integer values. The arguments must be integers. The step value defaults to 1 if it is omitted and if the start value is omitted it defaults to 0.&lt;/td&gt; &lt;td&gt;range(0, 5)&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;str(x)&lt;/td&gt; &lt;td&gt;Converts object x to a string representation&lt;/td&gt; &lt;td&gt;str(ans)&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;print([object, ...], sep=&#39; &#39;, end=&#39;\n&#39;, file=sys.stdout)&lt;/td&gt; &lt;td&gt;Print object(s) to the stream file, separated by sep and followed by end. sep, end and file, if present must be given as keyword arguments.&lt;/td&gt; &lt;td&gt;See below&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;input([prompt])&lt;/td&gt; &lt;td&gt;If the prompt argument is present, it is written to the standard output without a trailing newline. The function then reads a line from input, converts it to a string and returns that.&lt;/td&gt; &lt;td&gt;See below&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;b&gt;Print() Example&lt;/b&gt;&lt;br /&gt;
ans = 15&lt;br /&gt;
print(&quot;This is an example!&quot;)&lt;br /&gt;
print(&quot;This is another example:&quot;, 777)&lt;br /&gt;
print(ans)&lt;br /&gt;
print(&quot;The answer is:&quot;, ans)&lt;br /&gt;
print(&quot;I&quot;, &quot;like&quot;, &quot;pizza!&quot;)&lt;br /&gt;
print(&quot;I&quot;, &quot;like&quot;, &quot;pizza!&quot;, sep=&quot;-&quot;)&lt;br /&gt;
print(&quot;There are&quot;, ans, &quot;pizza slices left...&quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output from above:&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;This is an example!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;This is another example: 777&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;15&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;The answer is: 15&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;I like pizza!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;I-like-pizza!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;There are 15 pizza slices left...&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Input() Example&lt;/b&gt;&lt;br /&gt;
guess = input(&#39;Please enter your guess: &#39;)&lt;br /&gt;
name = input(&#39;Please enter your name: &#39;)&lt;br /&gt;
number = int(input(&#39;Enter number: &#39;))&lt;br /&gt;
print(&quot;Hello&quot;, name, &quot;you guessed&quot;, guess, &quot;and your number is&quot;, number)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output from above:&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;Please enter your guess: 10&lt;br /&gt;
Please enter your name: nathan&lt;br /&gt;
Enter number: 20&lt;br /&gt;
Hello nathan you guessed 10 and your number is 20&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Python has an extensive library of functions and as such, I can&#39;t possibly teach all of them. There is a help feature available to learn more about Pythons functions which can be accessed from the Python Shell.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Help -&amp;gt; Python Docs&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;You can also view the documentation on the &lt;a href=&quot;http://docs.python.org/py3k/library/index.html&quot;&gt;Python website&lt;/a&gt;. Two great libraries to look at are &lt;a href=&quot;http://docs.python.org/py3k/library/math.html&quot;&gt;math&lt;/a&gt; and &lt;a href=&quot;http://docs.python.org/py3k/library/random.html&quot;&gt;random&lt;/a&gt;, which will be upcoming in later exercises and examples.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Once you have a grasp on this lesson, continue on to &lt;a href=&quot;http://everythingpython.blogspot.com/2011/05/user-controlled-input-and-output.html&quot;&gt;User-Controlled Input and Output&lt;/a&gt;.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;-Nathan (everythingPython)&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://everythingpython.blogspot.com/feeds/8741435636895016241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://everythingpython.blogspot.com/2011/05/built-in-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/8741435636895016241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/8741435636895016241'/><link rel='alternate' type='text/html' href='http://everythingpython.blogspot.com/2011/05/built-in-functions.html' title='Built-in Functions'/><author><name>everythingpython</name><uri>http://www.blogger.com/profile/14468235809833874593</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-946847870710349072.post-2520827539557077007</id><published>2011-05-24T10:03:00.001+09:30</published><updated>2011-05-24T11:18:09.550+09:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="basics"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Exercises Part 1</title><content type='html'>Here are a couple exercises to test your current knowledge. These should be completed in a new &lt;a href=&quot;http://everythingpython.blogspot.com/2011/05/python-files.html&quot;&gt;Python file&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Assign the value 20 to a variable called width.&lt;br /&gt;
Assign the value 10 to a variable called height.&lt;br /&gt;
Define a variable called area to store the result of width * height.&lt;br /&gt;
Display the area to the screen using the print() function. *HINT* See the screenshot in the &lt;a href=&quot;http://everythingpython.blogspot.com/2011/05/naming-conventions-and-more.html&quot;&gt;last lesson&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Assign the value 10 to a variable called length.&lt;br /&gt;
Define a variable called area to store the result of length&lt;span class=&quot;larger&quot;&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/span&gt;. *HINT* See&lt;span style=&quot;font-size: small;&quot;&gt; &lt;a href=&quot;http://everythingpython.blogspot.com/2011/05/python-arithmetic-operators.html&quot;&gt;Python Arithmetic Operators&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Display the area to the screen using the print() function.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt; Once you have completed both of the exercises above, continue on to the next lesson: &lt;a href=&quot;http://everythingpython.blogspot.com/2011/05/built-in-functions.html&quot;&gt;Built-in Functions&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;-Nathan (everythingPython)&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://everythingpython.blogspot.com/feeds/2520827539557077007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://everythingpython.blogspot.com/2011/05/exercises-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/2520827539557077007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/2520827539557077007'/><link rel='alternate' type='text/html' href='http://everythingpython.blogspot.com/2011/05/exercises-part-1.html' title='Exercises Part 1'/><author><name>everythingpython</name><uri>http://www.blogger.com/profile/14468235809833874593</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-946847870710349072.post-8372813393248672272</id><published>2011-05-24T09:30:00.001+09:30</published><updated>2011-05-24T11:18:24.834+09:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="basics"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Naming Conventions and More</title><content type='html'>Okay, so you&#39;ve made it this far. Great work! Following the last couple of lessons, we will be going a bit more in-depth into the Python Naming Rules and Conventions, Keywords, Constants,&amp;nbsp; Variables and Comments.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
To start off, we will look at the rules for naming your variables.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;All names must start with a letter&lt;/li&gt;
&lt;li&gt;They may contain: letters, numbers, and the underscore character ( _ )&lt;/li&gt;
&lt;li&gt;The names are case sensitive. &lt;b&gt;count&lt;/b&gt; is different from &lt;b&gt;Count&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;There are certain keywords that cannot be used (seen later on)&lt;/li&gt;
&lt;/ul&gt;There are also some conventions that are recommended:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Using lowercase letters for variable names&lt;/li&gt;
&lt;li&gt;Using UPPERCASE letters for constants (seen later on)&lt;/li&gt;
&lt;li&gt;The names should be short enough to remember and must be self descriptive&lt;/li&gt;
&lt;/ul&gt;If you keep these things in mind, you will have a cleaner looking program, as well as one that can be easily read by other programmers.&lt;br /&gt;
&lt;br /&gt;
As discussed above, there are certain &lt;b&gt;keywords&lt;/b&gt; that cannot be used for variable names. They are as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;1&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;False&lt;/b&gt;&lt;/th&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;None&lt;/b&gt;&lt;/th&gt;     &lt;td&gt;&lt;b&gt;True&lt;/b&gt;&lt;/td&gt;     &lt;td&gt;&lt;b&gt;and&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;as&lt;/b&gt;&lt;/th&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;assert&lt;/b&gt;&lt;/th&gt;     &lt;td&gt;&lt;b&gt;break&lt;/b&gt;&lt;/td&gt;     &lt;td&gt;&lt;b&gt;class&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;continue&lt;/b&gt;&lt;/th&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;def&lt;/b&gt;&lt;/th&gt;     &lt;td&gt;&lt;b&gt;del&lt;/b&gt;&lt;/td&gt;     &lt;td&gt;&lt;b&gt;elif&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;else&lt;/b&gt;&lt;/th&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;except&lt;/b&gt;&lt;/th&gt;     &lt;td&gt;&lt;b&gt;finally&lt;/b&gt;&lt;/td&gt;     &lt;td&gt;&lt;b&gt;for&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;from&lt;/b&gt;&lt;/th&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;global&lt;/b&gt;&lt;/th&gt;     &lt;td&gt;&lt;b&gt;if&lt;/b&gt;&lt;/td&gt;     &lt;td&gt;&lt;b&gt;import&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;in&lt;/b&gt;&lt;/th&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;is&lt;/b&gt;&lt;/th&gt;     &lt;td&gt;&lt;b&gt;lambda&lt;/b&gt;&lt;/td&gt;     &lt;td&gt;&lt;b&gt;nonlocal&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;not&lt;/b&gt;&lt;/th&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;or&lt;/b&gt;&lt;/th&gt;     &lt;td&gt;&lt;b&gt;pass&lt;/b&gt;&lt;/td&gt;     &lt;td&gt;&lt;b&gt;raise&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;return&lt;/b&gt;&lt;/th&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;try&lt;/b&gt;&lt;/th&gt;     &lt;td&gt;&lt;b&gt;while&lt;/b&gt;&lt;/td&gt;     &lt;td&gt;&lt;b&gt;with&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;yield&lt;/b&gt;&lt;/th&gt;     &lt;th style=&quot;font-weight: normal;&quot;&gt;&lt;/th&gt;     &lt;td&gt;&lt;/td&gt;     &lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
As long as you stay away from these variable names you will have no problems. The next thing to cover is Variables and Constants.&lt;br /&gt;
&lt;br /&gt;
These are defined as:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Variable:&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;i&gt;adjective&lt;/i&gt;. able or liable to change&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;noun&lt;/i&gt;. a name given to a memory location designed to store a data value (Comp.Sci.)&lt;/li&gt;
&lt;li&gt;Called ‘variable’ as the value stored in it is likely to change during program execution&lt;/li&gt;
&lt;/ul&gt;&lt;b&gt;Constant:&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;i&gt;noun&lt;/i&gt;. a quantity that has a fixed value throughout a set of calculations&lt;/li&gt;
&lt;li&gt;Called ‘constant’ as once set, the value stored does not/cannot change during program execution&lt;/li&gt;
&lt;/ul&gt;When using either of these, you have to take into account what the variable will be used to store, and whether or not you will need to change the value of it later on.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Comments&lt;/b&gt; are a great way to describe what each part of code is doing in your program. It&#39;s beneficial to both you and anyone else who reads your code. To add comments to your code its as simple as adding the hash sign. The comment will span the entire line, when writing longer comments, it is best to split it amongst multiple lines, each starting with the hash sign. &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhepG9GZTqRqzRkNGaGmutdRWq3lYIOCddSQU6sUKtHhjqVaOgWlVImPrqHPTdyl7BOUKFPxryUuVNfBq-aWSz9wa8RjIi80tuz_9MZCsMPEv0DeBlHyyx3SB4JPWHT_l9wk2YzYWO9_mQU/s1600/comments.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;133&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhepG9GZTqRqzRkNGaGmutdRWq3lYIOCddSQU6sUKtHhjqVaOgWlVImPrqHPTdyl7BOUKFPxryUuVNfBq-aWSz9wa8RjIi80tuz_9MZCsMPEv0DeBlHyyx3SB4JPWHT_l9wk2YzYWO9_mQU/s320/comments.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
*NOTE* When using the print function, you must use quotations when outputting a string directly. If you are outputting a variable, they will not be needed (eg. print(myVariable))&lt;br /&gt;
&lt;br /&gt;
When running your program, the comments will be ignored, they are only there for your benefit and the benefit of those who read the code.&lt;br /&gt;
&lt;br /&gt;
That&#39;s it for this lesson. Play around with the comments and variables and see how you go. If you have any trouble, go back through the lessons, or post a comment, I&#39;m happy to answer any questions you may have!&lt;br /&gt;
&lt;br /&gt;
Continue on to: &lt;a href=&quot;http://everythingpython.blogspot.com/2011/05/exercises-part-1.html&quot;&gt;Exercises Part 1&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
-Nathan (everythingPython)</content><link rel='replies' type='application/atom+xml' href='http://everythingpython.blogspot.com/feeds/8372813393248672272/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://everythingpython.blogspot.com/2011/05/naming-conventions-and-more.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/8372813393248672272'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/8372813393248672272'/><link rel='alternate' type='text/html' href='http://everythingpython.blogspot.com/2011/05/naming-conventions-and-more.html' title='Naming Conventions and More'/><author><name>everythingpython</name><uri>http://www.blogger.com/profile/14468235809833874593</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhepG9GZTqRqzRkNGaGmutdRWq3lYIOCddSQU6sUKtHhjqVaOgWlVImPrqHPTdyl7BOUKFPxryUuVNfBq-aWSz9wa8RjIi80tuz_9MZCsMPEv0DeBlHyyx3SB4JPWHT_l9wk2YzYWO9_mQU/s72-c/comments.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-946847870710349072.post-882269765134343157</id><published>2011-05-24T09:21:00.000+09:30</published><updated>2011-05-24T11:18:38.765+09:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="basics"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Python Files</title><content type='html'>This is just a quick lesson to learn about opening and creating new Python files.&lt;br /&gt;
&lt;br /&gt;
To begin, open the Python Shell (IDLE). Go to &lt;b&gt;File&lt;/b&gt; -&amp;gt; &lt;b&gt;New Window&lt;/b&gt;, or press &lt;b&gt;Ctrl + N&lt;/b&gt; if you are on Windows. You should see the following window.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYvLinoeYOUQboqveSSvkIz49y5cq2jS7Uw2441z3mNK9DQiBOG4BzsE1X8GBlOilkjewU2pTPjAEZ6qvGBGrtoSRPGDGSMgb5_s0CfOvja1r9xFGIsYo-3LRGXqnIVBFqfDNPPeURiQHr/s1600/new_window.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;177&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYvLinoeYOUQboqveSSvkIz49y5cq2jS7Uw2441z3mNK9DQiBOG4BzsE1X8GBlOilkjewU2pTPjAEZ6qvGBGrtoSRPGDGSMgb5_s0CfOvja1r9xFGIsYo-3LRGXqnIVBFqfDNPPeURiQHr/s320/new_window.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
This is where you will write your programs code. It doesn&#39;t work like the Shell. The interpreter doesn&#39;t wait for your input like with the Shell, here you write your code, and then you can run the program. To do so, go to: &lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Run -&amp;gt; Run Module&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;To save your files, you just need to go to &lt;b&gt;File&lt;/b&gt; -&amp;gt; &lt;b&gt;Save As... &lt;/b&gt;and chose your file location and name. The file extension should be &lt;b&gt;.py&lt;/b&gt; (eg. helloWorld.py).&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;That&#39;s it for this lesson. Continue on to the next lesson: &lt;a href=&quot;http://everythingpython.blogspot.com/2011/05/naming-conventions-and-more.html&quot;&gt;Naming Conventions and More&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;-Nathan (everythingPython)&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://everythingpython.blogspot.com/feeds/882269765134343157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://everythingpython.blogspot.com/2011/05/python-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/882269765134343157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/882269765134343157'/><link rel='alternate' type='text/html' href='http://everythingpython.blogspot.com/2011/05/python-files.html' title='Python Files'/><author><name>everythingpython</name><uri>http://www.blogger.com/profile/14468235809833874593</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYvLinoeYOUQboqveSSvkIz49y5cq2jS7Uw2441z3mNK9DQiBOG4BzsE1X8GBlOilkjewU2pTPjAEZ6qvGBGrtoSRPGDGSMgb5_s0CfOvja1r9xFGIsYo-3LRGXqnIVBFqfDNPPeURiQHr/s72-c/new_window.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-946847870710349072.post-8621456852226876201</id><published>2011-05-24T00:10:00.002+09:30</published><updated>2011-05-24T11:18:46.124+09:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="basics"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Getting Started</title><content type='html'>So you&#39;ve decided to start programming and Python is the language you  want to learn. The first place you want to go is the Python website to  download the latest installation.&amp;nbsp; For these posts, I will be using  Python 3.2 which can be downloaded from the following link:&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a data-mce-href=&quot;http://python.org/download/&quot; href=&quot;http://python.org/download/&quot;&gt;&lt;b&gt;Download Python&lt;/b&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
You will want to select the appropriate Python 3.2 installation for your operating system. I used the &lt;b&gt;Python 3.2 Windows x86 MSI Installer&lt;/b&gt; for my system.&lt;br /&gt;
&lt;br /&gt;
Once you have it downloaded to your computer, you can go ahead and  install it. This is a fairly straightforward process and as such I will  not cover it unless any users request for a guide.&lt;br /&gt;
&lt;br /&gt;
Okay, so you  have it installed, now it&#39;s time to open it up and get started! You can  access the IDLE from either the desktop (if chosen during install) or  from the start menu (windows users).&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Start &amp;gt; All Programs &amp;gt; Python 3.2 &amp;gt; IDLE (Python GUI)&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
You should see the following screen (or similar) once it has finished loading.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKaHA3LT9IfL_22qmAddLuslVvBqJGWTXEDYZv_rLBPgK6zixROLHU5tbTKYlzBGwuHW9V8KLJoE7WE-wnQPq-fJehMFU-Ezk3_m4NwGTbVHzbE8ntF0XlptttwrFsq9LSK_ieVGzhHQzf/s1600/first_run.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;87&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKaHA3LT9IfL_22qmAddLuslVvBqJGWTXEDYZv_rLBPgK6zixROLHU5tbTKYlzBGwuHW9V8KLJoE7WE-wnQPq-fJehMFU-Ezk3_m4NwGTbVHzbE8ntF0XlptttwrFsq9LSK_ieVGzhHQzf/s320/first_run.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div data-mce-style=&quot;text-align: center;&quot; style=&quot;text-align: center;&quot;&gt;&lt;a data-mce-href=&quot;http://everythingpython.files.wordpress.com/2011/05/first_run.png&quot; href=&quot;http://everythingpython.files.wordpress.com/2011/05/first_run.png&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;div data-mce-style=&quot;text-align: center;&quot; style=&quot;text-align: center;&quot;&gt;&lt;br data-mce-bogus=&quot;1&quot; /&gt;&lt;/div&gt;&lt;div data-mce-style=&quot;text-align: left;&quot; style=&quot;text-align: left;&quot;&gt;As  you will see, the blinking cursor will indicate that the interpreter is  ready for you to enter a command/expression. This shell (window) can be  used to perform calculations, as you would on a calculator.&lt;/div&gt;&lt;div data-mce-style=&quot;text-align: left;&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div data-mce-style=&quot;text-align: left;&quot; style=&quot;text-align: left;&quot;&gt;That&#39;s  it! You&#39;re up and running, and now you can begin getting into the fun  stuff..okay, well it may not be too much fun, but it will help you out  in the long run when you start making more advanced programs.&lt;/div&gt;&lt;div data-mce-style=&quot;text-align: left;&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div data-mce-style=&quot;text-align: left;&quot; style=&quot;text-align: left;&quot;&gt;If everything is running as above you can now continue to the next lesson: &lt;a href=&quot;http://everythingpython.blogspot.com/2011/05/python-arithmetic-operators.html&quot;&gt;Python Arithmetic Operators&lt;/a&gt;&lt;/div&gt;&lt;div data-mce-style=&quot;text-align: left;&quot; style=&quot;text-align: left;&quot;&gt;&lt;br data-mce-bogus=&quot;1&quot; /&gt;&lt;/div&gt;&lt;div data-mce-style=&quot;text-align: left;&quot; style=&quot;text-align: left;&quot;&gt;-Nathan (everythingPython)&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://everythingpython.blogspot.com/feeds/8621456852226876201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://everythingpython.blogspot.com/2011/05/getting-started.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/8621456852226876201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/8621456852226876201'/><link rel='alternate' type='text/html' href='http://everythingpython.blogspot.com/2011/05/getting-started.html' title='Getting Started'/><author><name>everythingpython</name><uri>http://www.blogger.com/profile/14468235809833874593</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKaHA3LT9IfL_22qmAddLuslVvBqJGWTXEDYZv_rLBPgK6zixROLHU5tbTKYlzBGwuHW9V8KLJoE7WE-wnQPq-fJehMFU-Ezk3_m4NwGTbVHzbE8ntF0XlptttwrFsq9LSK_ieVGzhHQzf/s72-c/first_run.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-946847870710349072.post-5599145844716710073</id><published>2011-05-24T00:10:00.001+09:30</published><updated>2011-05-24T09:38:13.033+09:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="basics"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Python Arithmetic Operators</title><content type='html'>Okay, so we&#39;re up and running and we&#39;re ready to get into it! But  don&#39;t get ahead of yourself just yet, we need to cover some basics  first. It won&#39;t take long, but it&#39;s good to know what we&#39;re using and  what it does.&lt;br /&gt;
&lt;br /&gt;
The first thing we are going to cover is the Python  Arithmetic Operators. The following table will show the different  operators used with Python and what they do:&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;1&quot; cellspacing=&quot;2&quot; summary=&quot;Python Operators and Uses&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Operator&lt;/th&gt;&lt;th&gt;Use&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;+&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Addition - Used to add values. If using a floating point and an integer, the result will be a floating point. (Discussed Later)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;-&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Subtraction - Same as + (addition)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;*&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Multiplication Same as + (addition)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;/&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Division - Integer and floating point division will always result in a floating point.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;//&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&#39;Floor&#39; Operator - Returns the largest integer value less than the result if you use the Division Operator (Above).&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;%&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Modulo - Returns the remainder after division.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;**&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&#39;Power&#39; Operator - Works for integer and floating point values, returning the initial value to the power of the second value.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&amp;nbsp;Hopefully  that will explain what everything does clearly enough. Play around with  the different operators and see what kind of answers you get. You can  see some examples below of what to expect:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWDCRKolBVVcavtwJfdvzQj-hgelHsB_lEYgEy4C-XCQL01TkBlK95e2B7ZAICJFfViJ-kr4RX-SYnMcgeocuJEat2FiXopmrAiS3Mj9o8QHPVxKTmbZZoPemEHMDgE6zLUiLyFFn1VVFP/s1600/python_arithmetic_operators.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWDCRKolBVVcavtwJfdvzQj-hgelHsB_lEYgEy4C-XCQL01TkBlK95e2B7ZAICJFfViJ-kr4RX-SYnMcgeocuJEat2FiXopmrAiS3Mj9o8QHPVxKTmbZZoPemEHMDgE6zLUiLyFFn1VVFP/s320/python_arithmetic_operators.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a data-mce-href=&quot;http://everythingpython.files.wordpress.com/2011/05/python_arithmetic_operators.png&quot; href=&quot;http://everythingpython.files.wordpress.com/2011/05/python_arithmetic_operators.png&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
One thing to keep in mind when doing problems as seen above, is the order of operations. Python follows the standard algebraic rules for the order of operation:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Parentheses (innermost to outermost)&lt;/li&gt;
&lt;li&gt;Exponentiation operations&lt;/li&gt;
&lt;li&gt;Multiplication and division operations (left to right)&lt;/li&gt;
&lt;li&gt;Addition and subtraction operations (left to right)&lt;/li&gt;
&lt;/ul&gt;Following are some examples to try out to help you get used to the order of operations:&lt;br /&gt;
5 * (2+2) = ?&lt;br /&gt;
5 * 2 + 2 = ?&lt;br /&gt;
4 * 2 / 2 * 4 = ?&lt;br /&gt;
4 * 2 / (2 * 4) = ?&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;spoiler1&quot; style=&quot;display: none;&quot;&gt;&lt;b&gt;5 * (2 + 2) = 20&lt;br /&gt;
5 * 2 + 2 = 12&lt;br /&gt;
4 * 2 / 2 * 4 = 16&lt;br /&gt;
4 * 2 / (2 * 4) = 1&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;button onclick=&quot;if(document.getElementById(&#39;spoiler1&#39;)
.style.display==&#39;none&#39;) {document.getElementById(&#39;spoiler1&#39;)
.style.display=&#39;&#39;}else{document.getElementById(&#39;spoiler1&#39;)
.style.display=&#39;none&#39;}&quot; title=&quot;Click to show/hide content&quot; type=&quot;button&quot;&gt;Show Answer&lt;/button&gt; &lt;br /&gt;
&lt;br /&gt;
Now that we have that covered, you should have a grasp on the basic arithmetic operators and we can move on to the &lt;b&gt;Assignment Operator&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
The  Assignment Operator, is used to assign a value  to a variable. This is particularly useful when we need to store and  access values from memory. The assignment operator is a single equals sign ( &lt;b&gt;= &lt;/b&gt;). In the following example you will see one of the many ways it can be used.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMWN5PFf2ng7p6ZblXy2JUvYBB93f6p9jrHtFahZSTQjXOjn-7edLc9BKXl4KzcvjO1KGQpaO302r1BKgJRq8eolWW6ANRoNabYGCUrNHPEwIEAH9HLRU8SFhQG1J1qVkaSv2bSa_m0DsP/s1600/assignment_op.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;143&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMWN5PFf2ng7p6ZblXy2JUvYBB93f6p9jrHtFahZSTQjXOjn-7edLc9BKXl4KzcvjO1KGQpaO302r1BKgJRq8eolWW6ANRoNabYGCUrNHPEwIEAH9HLRU8SFhQG1J1qVkaSv2bSa_m0DsP/s320/assignment_op.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
In the above example, we use 3 variables (num1, num2, num3) to hold the values using the assignment operator. To use this, you type the name of the variable (using the appropriate naming conventions), the equal sign, the value, and press [Enter]. The value can then be accessed by typing in the variable name again. &lt;br /&gt;
&lt;br /&gt;
Using the above information, what would the following produce:&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;num = 6&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;num = num + 1&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;num = ??&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div id=&quot;spoiler&quot; style=&quot;display: none;&quot;&gt;&lt;b&gt;num = 7&lt;/b&gt;&lt;/div&gt;&lt;button onclick=&quot;if(document.getElementById(&#39;spoiler&#39;)
.style.display==&#39;none&#39;) {document.getElementById(&#39;spoiler&#39;)
.style.display=&#39;&#39;}else{document.getElementById(&#39;spoiler&#39;)
.style.display=&#39;none&#39;}&quot; title=&quot;Click to show/hide content&quot; type=&quot;button&quot;&gt;Show Answer&lt;/button&gt; &lt;br /&gt;
&lt;br /&gt;
The same method can be used to store string values (as below):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8G8bVsbDlPjezQ5q8WMVtspnxrNKDIvvShZxmJQZqeyK-h7CQZZOGd4BKQlzVHLpoMKHYvhjhyphenhyphenL6rU9eP9nVDegU3zwFIeyECkqh9n4_4HO62yq59hFxvQP9aIrsxD5PSqEzNGx8cJdui/s1600/string_var.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;105&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8G8bVsbDlPjezQ5q8WMVtspnxrNKDIvvShZxmJQZqeyK-h7CQZZOGd4BKQlzVHLpoMKHYvhjhyphenhyphenL6rU9eP9nVDegU3zwFIeyECkqh9n4_4HO62yq59hFxvQP9aIrsxD5PSqEzNGx8cJdui/s320/string_var.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;As you can see, outputting the value is different to the numerical value. When using strings, it is best to output the value using the print function which will be covered later on.&lt;br /&gt;
&lt;br /&gt;
Once you have gotten used to using arithmetic operators and assignment operators, you can move on to the next (short) lesson: &lt;a href=&quot;http://everythingpython.blogspot.com/2011/05/python-files.html&quot;&gt;Python Files&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
-Nathan (everythingPython)</content><link rel='replies' type='application/atom+xml' href='http://everythingpython.blogspot.com/feeds/5599145844716710073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://everythingpython.blogspot.com/2011/05/python-arithmetic-operators.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/5599145844716710073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/5599145844716710073'/><link rel='alternate' type='text/html' href='http://everythingpython.blogspot.com/2011/05/python-arithmetic-operators.html' title='Python Arithmetic Operators'/><author><name>everythingpython</name><uri>http://www.blogger.com/profile/14468235809833874593</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWDCRKolBVVcavtwJfdvzQj-hgelHsB_lEYgEy4C-XCQL01TkBlK95e2B7ZAICJFfViJ-kr4RX-SYnMcgeocuJEat2FiXopmrAiS3Mj9o8QHPVxKTmbZZoPemEHMDgE6zLUiLyFFn1VVFP/s72-c/python_arithmetic_operators.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-946847870710349072.post-2381261209045665845</id><published>2011-05-24T00:07:00.000+09:30</published><updated>2011-05-24T00:07:41.461+09:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>An Introduction!</title><content type='html'>Hi!&lt;br /&gt;
&lt;br /&gt;
If you&#39;ve found your way here you are probably interesting in  getting started with, or expanding your current knowledge of Python. If  you&#39;ve arrived here accidentally, feel free to have a look around, you  may have just found yourself a new hobby.&lt;br /&gt;
&lt;br /&gt;
Before we get into  anything, I&#39;d like to give users a look into what will be covered in the  upcoming posts. There are obviously many topics that will be covered in  the learning process, and each one is just as important as the last.  You may find some sections easy, and as such, you may not spend more  than a few minutes working through them, while others you may get stuck  on for hours. But don&#39;t let that get you down. Take a break. Come back  later. A relaxed mind is much easier to work with than one that is  stressed and over worked.&lt;br /&gt;
&lt;br /&gt;
The following topics are what you can look forward to learning about, and using in the upcoming exercises:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Language concepts; keywords, types, constants, variables,&lt;/li&gt;
&lt;li&gt;Expressions, Boolean expressions, precedence and associativity,&lt;/li&gt;
&lt;li&gt;Sequence, choice, loops,&lt;/li&gt;
&lt;li&gt;Functions, parameters,&lt;/li&gt;
&lt;li&gt;Strings,&lt;/li&gt;
&lt;li&gt;Lists (arrays). &lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;/ul&gt;If  you find yourself struggling with any of them, as I said before, take a  break and come back later with a clear mind, you may find that it is a  lot easier once you&#39;re more relaxed. If you are still having trouble  getting your mind around it, post a comment, don&#39;t be afraid to ask a  question, not everyone will learn straight away. It&#39;s all part of the  process.&lt;br /&gt;
&lt;br /&gt;
I hope everyone finds the information useful and that it  will get you started with what will hopefully be a fun programming  experience!&lt;br /&gt;
&lt;br /&gt;
-Nathan (everythingPython)</content><link rel='replies' type='application/atom+xml' href='http://everythingpython.blogspot.com/feeds/2381261209045665845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://everythingpython.blogspot.com/2011/05/introduction.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/2381261209045665845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/946847870710349072/posts/default/2381261209045665845'/><link rel='alternate' type='text/html' href='http://everythingpython.blogspot.com/2011/05/introduction.html' title='An Introduction!'/><author><name>everythingpython</name><uri>http://www.blogger.com/profile/14468235809833874593</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>