<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" 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" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7385891077026730373</atom:id><lastBuildDate>Thu, 26 Jul 2012 04:05:12 +0000</lastBuildDate><category>computer science</category><category>computer programming</category><category>java</category><category>iain m banks</category><category>python</category><category>software</category><category>engineering</category><category>programming for absolute beginners</category><category>qr code</category><category>keylogger</category><category>programming</category><category>development</category><category>computer</category><category>culture</category><category>server</category><category>digital home project</category><category>iain banks</category><category>c++</category><category>home automation</category><category>hardware</category><category>computing</category><title>Now We Try It My Way</title><description /><link>http://nowwetryitmyway.blogspot.com/</link><managingEditor>noreply@blogger.com (Jack Preston)</managingEditor><generator>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/nowwetryitmyway" /><feedburner:info uri="nowwetryitmyway" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7385891077026730373.post-6554146882729734807</guid><pubDate>Mon, 16 Jan 2012 22:19:00 +0000</pubDate><atom:updated>2012-01-16T14:22:12.723-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">qr code</category><category domain="http://www.blogger.com/atom/ns#">computer programming</category><category domain="http://www.blogger.com/atom/ns#">keylogger</category><category domain="http://www.blogger.com/atom/ns#">software</category><category domain="http://www.blogger.com/atom/ns#">hardware</category><category domain="http://www.blogger.com/atom/ns#">computer science</category><category domain="http://www.blogger.com/atom/ns#">computer</category><category domain="http://www.blogger.com/atom/ns#">computing</category><title>+1 Security on Public Computers</title><description>&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;I want to share a little service that's pretty nifty if you use a lot of public computers &lt;span style="color: #0b5394;"&gt;(in libraries, webcafes etc)&lt;/span&gt;. &amp;nbsp;A lot of this sort of computer, just because they get a lot of public traffic from a lot of different users, have various nasty software installed; besides a lot of ad/malware, a really common threat comes from&amp;nbsp;keyloggers. &amp;nbsp;This is software or hardware that sits quietly in the background of a computer and does exactly as its name suggests; logs keys. &amp;nbsp;Every key press that is registered by the keyboard can be captured by a keylogger, at which point it can store them away, waiting to be sent to an emailed to an external user, picked up on removal storage, whatever. &lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;When you consider that the kinds of things you type on this kind of computer, it usually covers your login details for email, social networks, organisers, documents, and more. &amp;nbsp;Also common &lt;span style="color: #0b5394;"&gt;(and really not recommended, not matter how good your security)&lt;/span&gt;&amp;nbsp;are details for online banking accounts. &amp;nbsp;So keyloggers are both dangerous and common things. &amp;nbsp;&lt;a href="http://www.scmagazineuk.com/keyloggers-found-plugged-into-library-computers/article/196936/"&gt;This article&lt;/a&gt;&amp;nbsp;from 2011 even mentions the possibility of immigration details being entered on potentially compromised machines.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;This is where my featured gadget comes in; it can't protect your logins to every service, but it &lt;i&gt;can&lt;/i&gt;&amp;nbsp;make logging into your Google account much more secure, and all you need is a smartphone&lt;span style="color: #38761d;"&gt;*&lt;/span&gt;. &amp;nbsp;And if you're like me, that gets you in to pretty much every service you use online anyway ^^. &amp;nbsp;Surprise surprise, it's provided by Google, and this is how it works;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;Get to the computer you suspect &lt;span style="color: #0b5394;"&gt;(and if it's used by anyone other than you on a regular basis, you should suspect it)&lt;/span&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;Before your head to any of your regular Google services, go to&amp;nbsp;&lt;a href="http://accounts.google.com/sesame"&gt;accounts.google.com/sesame&lt;/a&gt;&amp;nbsp;&lt;span style="color: #0b5394;"&gt;(as in 'open ...')&lt;/span&gt;. &amp;nbsp;You'll see something like this;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-Zm6pcGYKmDo/TxSfQ5TockI/AAAAAAAAADY/Mn3xlvPBfGE/s1600/qr.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-Zm6pcGYKmDo/TxSfQ5TockI/AAAAAAAAADY/Mn3xlvPBfGE/s320/qr.png" width="320" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li style="text-align: left;"&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;Hopefully you recognise this as a QR code. &amp;nbsp;If you do, you'll probably know that you need to whack out that smartphone I mentioned, and scan the picture you see using your favourite QR app.&lt;/span&gt;&lt;/li&gt;
&lt;li style="text-align: left;"&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;Your phone'll ask you to confirm that you want to let the horrible public computer be logged in to your Google account, you click yes, and watch as the site on your computer refreshes of its own free will and logs you in. &amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;What does the key log look like?&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;BLAH&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;BLAH&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;BLAH&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;accounts.google.com/sesame(ENTER)&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;did you know that computers only think in Courier? true story.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;No usernames, no passwords! &amp;nbsp;Just don't go typing out emails containing details about national security once you're into Gmail; kinda missing the point.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #38761d; font-family: 'Trebuchet MS', sans-serif;"&gt;* If you don't have one of these, just go out and get one, alright? &amp;nbsp;They're wizard. &amp;nbsp;I recommend&amp;nbsp;&lt;a href="http://www.android.com/about/"&gt;Android&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/nowwetryitmyway/~4/6pQF2YYUpx4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/nowwetryitmyway/~3/6pQF2YYUpx4/1-security-on-public-computers.html</link><author>noreply@blogger.com (Jack Preston)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-Zm6pcGYKmDo/TxSfQ5TockI/AAAAAAAAADY/Mn3xlvPBfGE/s72-c/qr.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://nowwetryitmyway.blogspot.com/2012/01/1-security-on-public-computers.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7385891077026730373.post-4285117120249918349</guid><pubDate>Mon, 02 Jan 2012 17:10:00 +0000</pubDate><atom:updated>2012-01-03T05:39:57.295-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">server</category><category domain="http://www.blogger.com/atom/ns#">home automation</category><category domain="http://www.blogger.com/atom/ns#">computer programming</category><category domain="http://www.blogger.com/atom/ns#">development</category><category domain="http://www.blogger.com/atom/ns#">digital home project</category><category domain="http://www.blogger.com/atom/ns#">software</category><category domain="http://www.blogger.com/atom/ns#">engineering</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">computer science</category><category domain="http://www.blogger.com/atom/ns#">computer</category><category domain="http://www.blogger.com/atom/ns#">computing</category><title>Digital Home Project</title><description>&lt;br /&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;Hello everybody! &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;I'm about to embark on a project that I wanted to document through this blog under the heading of the "Digital Home Project". &amp;nbsp;The title probably gives it away, but let me detail the aims of it all. &amp;nbsp;I thought of the fun you could have with a house &lt;/span&gt;&lt;span style="color: #666666; font-family: Arial,Helvetica,sans-serif;"&gt;(or flat, or even just student room!)&lt;/span&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp;which is essentially computer controlled. &amp;nbsp;Not in a HAL-9000 kind of a way, but just simple things that it would be useful / fun / possibly economical to make controllable from a computer; lights, heating, radios to name a few that have come to mind...&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;Imagine, as a bit of thought candy, being woken up in the morning by a nicely warmed room &lt;span style="color: #666666;"&gt;(that bit might not seem like might to a lot of you, but my flat's a little archaic and the heating isn't timer controlled - yet :D)&lt;/span&gt;&amp;nbsp;and the sounds of your favourite radio station, iTunes or last.fm playlist; whatever you'd like really. &amp;nbsp;Lights fade in / curtains are drawn. &amp;nbsp;Once you've woken up properly, the system switches over to a default 'daytime' theme; background music plays, lights switch on when they're needed according to the existing light levels, and so on.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-8Z9wNxQw1PI/TwME-brnVKI/AAAAAAAAADI/79r_ratqHyY/s1600/lancable.jpg" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="212" src="http://3.bp.blogspot.com/-8Z9wNxQw1PI/TwME-brnVKI/AAAAAAAAADI/79r_ratqHyY/s320/lancable.jpg" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;a href="http://www.freedigitalphotos.net/images/view_photog.php?photogid=1701"&gt;Image:
 scottchan / FreeDigitalPhotos.net&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;/span&gt; &lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;The real fun would come in having all this controlled and monitored by a central dedicated computer (the server) running software also created by me. &amp;nbsp;Ideally, it would have some feature whereby information from various sensors around the place could be used in scripts to control elements of the house.&lt;/span&gt; &lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;/span&gt; &lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;So the key elements of the system are;&lt;/span&gt;  &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;A server computer, probably running a Linux distribution for the amount of customisability I'd like.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;Server software running on the server, written by myself, running constantly to control and monitor.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;Little hardware sensors for various levels; light, noise, temperature and so on.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;Hardware controllers of different sorts, including on / off switches and gradual (dimmer) switches.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;Some mechanism allowing the server to know the reading from any of the sensors and command any controller as it sees fit. &amp;nbsp;Hopefully, this will be done wirelessly, probably over a civilian radio frequency. &amp;nbsp;You seem to be able to get the modules for this kind of radio communication reasonably cheaply - I'd need to set up some kind of communication protocol to allow addressing of each sensor and so forth.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;I'll try and tackle things in a reasonably modular way, designing things one by one so as to have a nice readable record of things here. &amp;nbsp;I'll most likely start with the design of at least one sensor &lt;span style="color: #666666;"&gt;(probably light)&lt;/span&gt;, since with that I can begin development of other parts, and more will follow in a very similar form. &amp;nbsp;I have a little experience with electronics and programmable microcontrollers, so I should be able to muddle through! &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial,Helvetica,sans-serif;"&gt;This was just a bit of an intro post to bring in the new project; expect design work to start... now!&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/nowwetryitmyway/~4/ynVBOKmHDB0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/nowwetryitmyway/~3/ynVBOKmHDB0/digital-home-project.html</link><author>noreply@blogger.com (Jack Preston)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-8Z9wNxQw1PI/TwME-brnVKI/AAAAAAAAADI/79r_ratqHyY/s72-c/lancable.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://nowwetryitmyway.blogspot.com/2012/01/digital-home-project.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7385891077026730373.post-6248636945992545914</guid><pubDate>Sun, 18 Dec 2011 20:49:00 +0000</pubDate><atom:updated>2012-01-02T08:13:33.752-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">programming for absolute beginners</category><category domain="http://www.blogger.com/atom/ns#">computer programming</category><category domain="http://www.blogger.com/atom/ns#">development</category><category domain="http://www.blogger.com/atom/ns#">software</category><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">computer</category><title>Programming for Absolute Beginners 2</title><description>&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Hey guys and girls!&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Last time we looked at making your first Python program. &amp;nbsp;It consisted of a single line of code, and it made the computer shout a friendly greeting to the world at large. &amp;nbsp;Earth-shaking as that was, let's get stuck in to the nitty gritty of learning to program now! &amp;nbsp;For a little while, but hopefully not too long, it might feel a bit like "hey, when do we get to make GOOD stuff?!", but there's a little bit of the basics that need to be covered first. &amp;nbsp;I'll try and do as little as physically possible before we embark on a little project to really learn by doing :D&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;u&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Program Flow&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;u&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Okeydokey then. &amp;nbsp;The first thing you need to know, and believe me before long it'll be something you forgot you even had to be told, is that programs have what's called a &lt;i&gt;flow. &amp;nbsp;&lt;/i&gt;Program flow refers to the course that a program takes through the code you wrote. &amp;nbsp;With most programming languages, Python included, program flow progresses linearly downwards through your code line by line (you can send it in different directions for your own needs, but we'll get to that). &amp;nbsp;So, if you write a program like;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;python_code_line_1&lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;python_code_line_2&lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;python_code_line_3&lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;python_code_line_4&lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;python_code_line_5&lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;and save the code as a .py file, then pass that to the Python interpreter, it'll look at line 1, then line 2, and so on, until it gets to line 5. &amp;nbsp;It'll read line 5 as well, and then the program will finish, because we got to the end of the program's flow. &amp;nbsp;Those of you who took the extra challenge last time of writing the program;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;print("Hello World!")&lt;/code&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;print("Hello World!")&lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;print("Hello World!")&lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;print("Hello World!")&lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;print("Hello World!")&lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;will have seen the computer shout out the message five times. &amp;nbsp;This is simply because it looked at each line in turn, starting from the top, and interpreted each one individually. &amp;nbsp;It didn't go backwards, or start doing other stuff that we didn't ask it to, it just went through, line by line, and that's what it'll do whenever it's not being told to do anything else.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;That's all I'll say about program flow for the moment, we'll get back onto it later when we talk about changing it :D&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;Variables&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;One of the most (if not the most) fundamental ideas in programming is a &lt;i&gt;variable&lt;/i&gt;. &amp;nbsp;In essence, a variable is a container for information within your program. &amp;nbsp;Not just that, it's a container that you can give a label. &amp;nbsp;Imagine you have two piggie banks, both empty. &amp;nbsp;You stick a label on one saying "Arnold" (that's his name), and a label on the other saying "Bernard". &amp;nbsp;These piggies are the variables in this situation. &amp;nbsp;We'll model them with a little program as we go, so open up a new Python editor window like we did in the last lesson, and enter the following code;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;arnold = 0&lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;bernard = 0&lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;print(arnold)&lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;print(bernard)&lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Now, when you run this program, you should see&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;0&lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;0&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;printed out by the computer. &amp;nbsp;Let's look at what happened line-by-line (that's what the computer did!)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: monospace;"&gt;arnold = 0&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;This says to th&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;e interpreter; "make me a variable (piggie bank) labelled arnold, and set its &lt;/span&gt;&lt;i style="font-family: Arial, Helvetica, sans-serif;"&gt;value&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;to 0". &amp;nbsp;So the variable has a sense of value; the amount in money in it is represented by this value. &amp;nbsp;At the moment, there's no money in Arnold, so the &lt;code&gt;arnold&lt;/code&gt; variable has value 0. &amp;nbsp;By the way, I'm using Arnold (not the capital A) for the piggie bank and arnold for the variable. &amp;nbsp;It's not important what you call your variable, but you &lt;/span&gt;&lt;i style="font-family: Arial, Helvetica, sans-serif;"&gt;must&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;keep using that same name consistently to refer to it. &amp;nbsp;And when I say consistently, that includes the case of letters; if you use the code above to make your 'arnold' variable, then later on Python won't know what you mean if you start talking about 'Arnold'.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;The next line;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;bernard = 0&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;does the same thing, making another variable (piggie bank) called bernard, and putting zero money in it. &amp;nbsp;The next two lines do a very similar job to what &lt;code&gt;print("Hello World!")&lt;/code&gt; did, except now they print the &lt;i&gt;value&lt;/i&gt;&amp;nbsp;of the variables arnold and bernard, not the &lt;i&gt;words&lt;/i&gt;&amp;nbsp;arnold and bernard. &amp;nbsp;This is because of the lack of quotation marks. &amp;nbsp;To illustrate this, add the following two lines to the end of your program, save it and run it again;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;print("arnold")&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;print("bernard")&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;You should now see the following output;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;0&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;0&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;arnold&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;bernard&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Putting the quotation marks around the words made them into something called &lt;i&gt;strings&lt;/i&gt;. A string is a load of literal text, that you want the interpreter to look at as such, and not do anything clever with, like treating it as a variable.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;We'll do two last things with variables; firstly, we'll look at changing the value of variables during the program flow. &amp;nbsp;The name 'variable' gives away that the value of a variable might be able to change, right? Well, just as you can add money to your piggie bank, you can also change the amount of money represented by your variables. &amp;nbsp;Imagine putting £10 in the piggie labelled Arnold. &amp;nbsp;You know he currently holds zero money, so after this he'll hold the grand sum of £10! &amp;nbsp;Add the following lines to your program, and run it again;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;arnold = 10&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;print(arnold)&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;You should now see the following printed out by the computer;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;0&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;0&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;arnold&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;bernard&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;10&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;This is because the computer goes through the program &lt;i&gt;line by line; &lt;/i&gt;when it came across the first arnold printing command, at that time he had zero money stored in him. &amp;nbsp;Before reaching the next print command, though, we set the money in him to 10, and so when we came to print, that was the value he had. &amp;nbsp;So the value of variables can &lt;i&gt;change during program flow&lt;/i&gt;. &amp;nbsp;This is the mechanism that drives even the biggest, most complex programs!&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Now, what about Bernard? &amp;nbsp;We knew that Arnold had £0, so we knew that we could represent adding £10 by setting his value to 10. &amp;nbsp;But what if we didn't actually know how much money there was in him? &amp;nbsp;Let's pretend like we don't know how much money is in Bernard. &amp;nbsp;We still want to add £10 to him though, so how do we do this? &amp;nbsp;Well, as well as &lt;i&gt;setting&lt;/i&gt;&amp;nbsp;the value of variables, like we did with arnold, we can &lt;i&gt;read&lt;/i&gt;&amp;nbsp;their values, and use them in some simple arithmetic; try adding the following two lines to your hefty program;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;bernard = bernard + 10&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;print(bernard)&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Now, to anyone who's done even a little bit of maths, the first line should look a bit stupid; how can bernard be equal to himself plus 10?! &amp;nbsp;Well, let's run the program and see that we get the following output;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;0&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;0&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;arnold&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;bernard&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;10&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;10&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;So when we come to print the value of bernard, we find that he also has £10 in him. &amp;nbsp;Let's look at the important line here; &lt;code&gt;bernard = bernard + 10&lt;/code&gt;. &amp;nbsp;As before, writing;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;bernard = STUFF&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;will &lt;i&gt;set the value&lt;/i&gt;&amp;nbsp;of the bernard variable to whatever STUFF is. &amp;nbsp;When we set arnold, STUFF was 10. &amp;nbsp;When we set bernard, STUFF was 'bernard + 10'. &amp;nbsp;The computer went away and figured out what bernard + 10 was equal to (in this case bernard was 0, so bernard + 10 was 10 :D), then set the value of bernard to that. &amp;nbsp;That is, the bit on the &lt;i&gt;right&lt;/i&gt;&amp;nbsp;hand side of the = sign was worked out, &lt;i&gt;then&lt;/i&gt;&amp;nbsp;the variable was set with that value.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;That about concludes today's look at the beginnings; we've covered the idea that a program runs by stepping through lines one by one, moving down the code as it's written on screen, just like you would read a book! Well, if you read books written in a left-to-right, top-to-bottom script like English at least... &amp;nbsp;We saw that variables are like labelled containers for information, and this information is called the &lt;i&gt;value&lt;/i&gt;&amp;nbsp;of the variable. &amp;nbsp;This value can change during the program, hence the name 'variable'. &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;We saw two ways to change the value of a variable; by setting it to an absolute value like 10, or by setting it to the result of a little arithmetic. &amp;nbsp;Next time, we'll look a little bit at the different types of information variables can hold (it's not just pound coins!), and move onto &lt;i&gt;controlling program flow&lt;/i&gt;, which is where things start getting exciting :D&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;As a little bit of homework; look at the following lines of code, work out what'll be printed out when you run them as a program, then write it and run it to check yourself! &amp;nbsp;Remember, the computer doesn't care about what names you give your variables, they don't all have to be hilarious pig names.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;variable_1 = 1000&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;variable_2 = 2000&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;variable_3 = variable_1 + variable_2&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;print(variable_3)&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;variable_3 = variable_3 + variable_2&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;print(variable_3)&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;variable_2 = variable_3&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;print("variable_2")&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Hint: a piece of paper can be useful ^^&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://feeds.feedburner.com/nowwetryitmyway" rel="alternate" type="application/rss+xml"&gt;&lt;img alt="" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" style="border: 0; vertical-align: middle;" /&gt;&lt;/a&gt;&amp;nbsp;&lt;a href="http://feeds.feedburner.com/nowwetryitmyway" rel="alternate" type="application/rss+xml"&gt;Subscribe to NowWeTryItMyWay&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span id="fullpost"&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/nowwetryitmyway/~4/Qko0_ZBHD3c" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/nowwetryitmyway/~3/Qko0_ZBHD3c/programming-for-absolute-beginners-2.html</link><author>noreply@blogger.com (Jack Preston)</author><thr:total>0</thr:total><feedburner:origLink>http://nowwetryitmyway.blogspot.com/2011/12/programming-for-absolute-beginners-2.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7385891077026730373.post-2832338159981118353</guid><pubDate>Fri, 09 Dec 2011 18:23:00 +0000</pubDate><atom:updated>2012-01-02T08:13:41.219-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">programming for absolute beginners</category><category domain="http://www.blogger.com/atom/ns#">computer programming</category><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>Programming for Absolute Beginners 1</title><description>&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
Ok, I decided to make good on my previous post and actually show some people (hopefully) how to do a bit of basic programming.&amp;nbsp; I'll do this in a sequence of posts, hopefully linked up quite nicely, and before you know it you'll be bashing all up on the keyboard and shouting "I'm in!" like in the movies.&amp;nbsp; Let's get going.&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
We'll be learning in &lt;i&gt;Python.&amp;nbsp; &lt;/i&gt;Python is a computer programming language that is commonly viewed as both being pretty OK to learn, and demonstrating a lot of the core ideas in modern programming.&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-2t9i5OE1Sqc/TuJnO_ciLfI/AAAAAAAAAC4/y8Ab9Tu9eOA/s1600/1.0+Python+logo.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-2t9i5OE1Sqc/TuJnO_ciLfI/AAAAAAAAAC4/y8Ab9Tu9eOA/s1600/1.0+Python+logo.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;The Python Logo - kinda two chunky (and therefore computery) looking snakes coiled.&lt;br /&gt;
&lt;a href="http://wadah-it.com/wp-content/uploads/2010/06/python-logo.png"&gt;Original Image&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
I said this is for complete beginners (if you're not one, but you don't know Python, feel free to use this to learn, but you'll want to skip bits and pieces), so I'll fill you in on what the above means.&amp;nbsp; The word language is a pretty accurate one; imagine that Python is an actual, speakable language just like English or Japanese.&amp;nbsp; You might not be able to understand if someone came up to you and starting yammering on in Japanese, but neither would your computer.&amp;nbsp; Importantly, you've got a much better chance of learning Japanese than your computer ever has.&amp;nbsp; Now, if your computer started talking to you in &lt;i&gt;its&lt;/i&gt; native language, it'd probably be even more impenetrable, just a string of complete rubbish.&amp;nbsp; This is where Python comes in; it's a language that's been designed in a way that means us humans can learn to speak it, &lt;i&gt;and&lt;/i&gt; that it can be quite easily translated to the computer's language for it to understand.&amp;nbsp; It provides a communication link between us and the computer.&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
For us, learning Python consists of reading something like this tutorial and trying it out 'till we get it right.&amp;nbsp; For the computer, it consists of having an &lt;i&gt;interpreter &lt;/i&gt;around to tell it what the Python means.&amp;nbsp; The Python interpreter is a piece of software that you install on the computer; you give it instructions written in Python for the computer, and it translates and hands those instructions over.&amp;nbsp; By the way, the word interpreter isn't me taking the talking computers metaphor too far; it's actually called that.&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
So let's start by doing just that; installing the Python interpreter on your computer &lt;span style="color: #666666;"&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;by the by, if you're on a computer running some kind of Linux instead of Windows, you've possibly already got it; try typing "python" at a terminal.&amp;nbsp; If not, or you have no idea what Linux is, ignore this bracket!&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;/span&gt;.&amp;nbsp; If you head over to &lt;a href="http://www.python.org/"&gt;python.org&lt;/a&gt; and click on &lt;a href="http://python.org/download/"&gt;DOWNLOAD&lt;/a&gt; on the left hand side, you'll be taken to the downloads page.&amp;nbsp; Ignore the "Alternative Implementations" section, and go down to the list of links starting "Python 2.x.y"; x is probably 7 unless you're reading this long after I write it.&amp;nbsp; These are the downloads for the Python version 2.x interpreter, there's a version 3 but it's (I think) slightly less widely used at the moment.&amp;nbsp; Choose the one that's right for your computer, and download!&amp;nbsp; Most of you'll probably want the "Windows Installer"s.&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
Go through the process of running the file you just downloaded (&lt;span style="color: #666666;"&gt;or if you went for some kind of source download, do what you have to do; I would guess you know how if you decided to do that...&lt;/span&gt;) and choose to install things in the default directory it suggests (on Windows, this is usually C:\Python27 for Python 2.7).&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
And that's it; Python is installed and ready to start translating for you, so you can order the computer around.&amp;nbsp; Let's try writing our first program.&amp;nbsp; There's a tradition in the programming world that the first program you write in a new language, especially if it's your first one, is a "Hello World" program.&amp;nbsp; This program does nothing more than write the words "Hello, World!" onto your screen, and Python allows you to do it with less effort than most languages.&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
Make yourself a folder somewhere, and call it something like "python"; it'll be good to keep things you learn to do all in the same place.&amp;nbsp; Within this folder, make a folder for this program; call it something like "1hello" or whatever you'd like (I have a preference for no spaces or capitals in my folder/file names, sorry!).&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
Now go to your start menu (that's right, from now on I'm going to talk as if you're using some kind of Windows, if you can't work out how to do it on your computer, let me know and I'll try to help, or Google it!) and find the Python 2.x folder.&amp;nbsp; In that, there should be a program you can run called "IDLE (Python GUI)" or similar.&amp;nbsp; Go ahead and open it up, and you'll see something very like this;&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-Kdkj_mYVmr0/TuJcQCyWwnI/AAAAAAAAACY/zmJiFsxP4Lk/s1600/1.1+Python+Shell.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/-Kdkj_mYVmr0/TuJcQCyWwnI/AAAAAAAAACY/zmJiFsxP4Lk/s400/1.1+Python+Shell.png" width="380" /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: left;"&gt;
This is called the Python &lt;i&gt;Shell&lt;/i&gt;; I'll go into this more later, but it's not actually what we're interested in right now.&amp;nbsp; Click File - New Window and you'll see this;&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-G-l_fb3Ri7k/TuJc2pbWXnI/AAAAAAAAACg/oxAWOz3r1f8/s1600/1.2+Python+Editor+Window" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/-G-l_fb3Ri7k/TuJc2pbWXnI/AAAAAAAAACg/oxAWOz3r1f8/s400/1.2+Python+Editor+Window" width="380" /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: left;"&gt;
This may look practically identical to the other window, but it's fundamentally different.&amp;nbsp; Think of the first one as a kind of conversation window; on that one you can type little bits of Python at a time to see how the computer acts, to test out things you want to try and do etc.&amp;nbsp; This second window is more like a classic text editor window; you can save text files from it, and these text files (which will be saved with a .py file extension, rather than something like .txt) are what will make up your Python program.&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: left;"&gt;
So the Python program is like a script; you write down all the things you want to tell the computer to do, in order in a list (that is, in lines in your .py file) and you can read the same script over and over again and you'll always give the same instructions.&amp;nbsp; The word &lt;i&gt;script&lt;/i&gt; is actually very relevant; &lt;i&gt;scripting &lt;/i&gt;is a real thing very closely related to &lt;i&gt;programming&lt;/i&gt;, and a lot of people refer to Python as a scripting language, not a programming language.&amp;nbsp; But let's not complicate things :D.&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: left;"&gt;
Finally, we're all set up to start writing our first program!&amp;nbsp; In your editor window (the one you just opened), type the following (by the way, it's good if you actually do &lt;i&gt;type&lt;/i&gt; it; it seems trivial just to copy and paste what's here, but it's important to get a feel for various aspects of the things you need to write);&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: left;"&gt;
&lt;code&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: left;"&gt;
&lt;code&gt;&lt;br /&gt;
print("Hello, World!")&lt;/code&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: left;"&gt;
&lt;code&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;and save it (File &lt;/span&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;- Save As...) as hello.py in the folder you made for this program earlier.&amp;nbsp; You'll now have this;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-oIJORvo6-qg/TuJfz_blrmI/AAAAAAAAACo/2U43d1Ir_uI/s1600/1.3+Hello+World.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://4.bp.blogspot.com/-oIJORvo6-qg/TuJfz_blrmI/AAAAAAAAACo/2U43d1Ir_uI/s400/1.3+Hello+World.png" width="380" /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;That file's a Python program, believe it or not!&amp;nbsp; I bet you're raring to see it run, no? :D Click Run - Run Module (or press F5 on your keyboard, same thing...), and you'll be taken back to that first window, only now your program will run, and your computer will have a little message for the great big world; &lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-lzqWySRgzhE/TuJgd76R3TI/AAAAAAAAACw/ksTd1YCTDgs/s1600/1.4+Hello+World+Running.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/-lzqWySRgzhE/TuJgd76R3TI/AAAAAAAAACw/ksTd1YCTDgs/s400/1.4+Hello+World+Running.png" width="380" /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: left;"&gt;
If you don't see this, and instead see a lot of stuff in red, you need to make sure you've written the instruction &lt;i&gt;exactly&lt;/i&gt; like I did, and try again.&amp;nbsp; By default, the Python Shell displays text that comes from the computer (as opposed to stuff you type) in blue.&amp;nbsp; So that's it shouting Hello, World! out at you!&amp;nbsp; Well, phew, that was fun.&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;What just happened? When you clicked "Run Module", you gave the Python interpreter the file you just wrote.&amp;nbsp; Remember I said it was like a script? That's exactly how the interpreter treated it; imagine a real human language interpreter&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt; taking a script written on a piece of paper and reading through it line by line, translating as they go.&amp;nbsp; That's what the Python interpreter did, it's just that this script only had one line, and it translated into computer language.&lt;/span&gt;&amp;nbsp; The instruction&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; text-align: left;"&gt;
&lt;code&gt;print("Hello, World!")&lt;/code&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;code&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;just tells the computer to &lt;i&gt;print&lt;/i&gt; (that is, write to the screen) the words "Hello, World!".&amp;nbsp; If you'd written it five times, like this;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;print("Hello, World!")&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;print("Hello, World!")&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;print("Hello, World!")&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;print("Hello, World!")&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;print("Hello, World!")&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;save the file, and click Run Module again, surprise surprise; the computer writes it five times!&amp;nbsp; In fact, go do exactly that, for funsies.&lt;/span&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;I'll leave getting into exactly how that instruction is made up 'till the next lesson, because there was a lot of time spent setting Python up on your computer this time around.&amp;nbsp; Now it's installed and working, writing programs is as easy as opening up IDLE, creating a new window, and writing your .py files :D.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Come back soon for a proper start into programming, kicking off with what &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;print&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt; does, how the interpreter knows what it means, and the reasons for all the brackets and quotation marks.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;I hope that went smoothly for you, you can now legitimately tell your friends you're a computer programmer and that it's well easy innit.&amp;nbsp; If you had any problems with anything, leave a comment, or try getting into the habit of copying any relevant looking errors etc. into Google with the word Python and finding out that millions of others have had the same problem before you.&amp;nbsp; You're not alone!&amp;nbsp; Making mistakes is practically the key part of programming, and honestly, even the actual professionals make just as many of them.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://feeds.feedburner.com/nowwetryitmyway" rel="alternate" type="application/rss+xml"&gt;&lt;img alt="" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" style="border: 0; vertical-align: middle;" /&gt;&lt;/a&gt;&amp;nbsp;&lt;a href="http://feeds.feedburner.com/nowwetryitmyway" rel="alternate" type="application/rss+xml"&gt;Subscribe to NowWeTryItMyWay&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/nowwetryitmyway/~4/Masm21FYwZM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/nowwetryitmyway/~3/Masm21FYwZM/programming-for-absolute-beginners-1.html</link><author>noreply@blogger.com (Jack Preston)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-2t9i5OE1Sqc/TuJnO_ciLfI/AAAAAAAAAC4/y8Ab9Tu9eOA/s72-c/1.0+Python+logo.png" height="72" width="72" /><thr:total>0</thr:total><georss:featurename>Cambridge, UK</georss:featurename><georss:point>52.205337 0.121817</georss:point><georss:box>52.1664135 0.04285299999999999 52.2442605 0.200781</georss:box><feedburner:origLink>http://nowwetryitmyway.blogspot.com/2011/12/programming-for-absolute-beginners-1.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7385891077026730373.post-8134103355554541051</guid><pubDate>Tue, 29 Nov 2011 23:16:00 +0000</pubDate><atom:updated>2012-01-02T08:13:46.992-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">c++</category><category domain="http://www.blogger.com/atom/ns#">java</category><category domain="http://www.blogger.com/atom/ns#">computer programming</category><category domain="http://www.blogger.com/atom/ns#">development</category><category domain="http://www.blogger.com/atom/ns#">software</category><category domain="http://www.blogger.com/atom/ns#">engineering</category><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">computer science</category><category domain="http://www.blogger.com/atom/ns#">computer</category><category domain="http://www.blogger.com/atom/ns#">computing</category><title>Making Computers Really Work</title><description>&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
So I want to talk a little bit about the topic of computing, and in particular about computer programming. &amp;nbsp;&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
Programming's something which pretty much divides people into two distinct groups, as far as my experience goes.&amp;nbsp; One group has it locked in quite tightly with the other mysterious arts of digital times; the work of hidden very-clever-clogs in the big technological companies, and that of the nefarious hackers and other cyber-criminals, equally gifted with intelligence but a bit more dastardly and twisted.&amp;nbsp; This group tends to know very little about the process of programming, and often isn't even aware of the existence of programming &lt;i&gt;languages&lt;/i&gt; as tools of the trade.&amp;nbsp; This isn't an ignorance I judge them for in any way, for reasons I'll go into in a minute.&amp;nbsp; Now, the other group; the other group knows all about the power, fun and sometimes frustrations of being able to program, because they've found out how to do it.&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
I say 'found out' quite deliberately, because it implies a good amount about what I wanted to talk about here.&amp;nbsp; Consider the first group I mentioned above.&amp;nbsp; Most people don't do a vast amount of independent learning once they're out of the full-time education of the first chunk of their lives; maybe a little here and there, looking into topics they're already interested in, reading books on hobbies and such, but otherwise if folk don't know something then it's because they weren't taught it by somebody else while they were at school, or if they went, university.&amp;nbsp; We live in a literate world, a good chunk of the population is capable of at least basic maths and usually knows a little of at least their own culture's history.&amp;nbsp; However, the first time anyone even has a chance of being taught about computer programming is when they're around 18 and they decide they like computers enough to go off and do a degree like Computer Science at university.&amp;nbsp; I'm speaking from my experience of the British education system here, but I would assume it's a similar situation elsewhere; let me know about where you live.&amp;nbsp; So, most people who program have had to find out about it themselves.&amp;nbsp; They're people who've seen what computers do and been intrepid enough to (most likely) get straight on the Google and ask it how.&amp;nbsp; From there, they learned that all this is done in general by writing programs in programming languages.&amp;nbsp; So then they probably asked it which one of these might be good to learn, probably more specifically which one you'd use to program a fantastic game, and ended up with something like Python, because a lot of people think it's a good starting point, or like C++ because it's used heavily in the industry.&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
This is pretty much the path into things I took as a maths student at university only about five years ago now.&amp;nbsp; I found an online tutorial from which I learned some pretty basic Python programming, probably tried to make some kind of text game, got a bit annoyed that graphics seemed to be completely beyond me, and things went from there.&amp;nbsp; By the end of university I'd self-taught enough to apply for my current job as a software developer and get it.&amp;nbsp; So it's really not too hard, and you don't have to get to a professional standard to enjoy the real day-to-day power of the skill.&amp;nbsp; I find it incredible that practically everybody uses computers everyday, many people using them for a good portion of their waking lives, and even the most basic education in a skill which does nothing really more than allow you to ask them to do what you actually want doesn't exist compulsorily.&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;
It's something I basically do all day, and now comes very naturally to me in a couple of the many many different languages, and I like to at least try to lift the lid on how it works to anyone who wants to find out.&amp;nbsp; Once you can do some basic messing around with some kind of light programming language, any little bits and pieces of work on computers can be fixed up quickly and just as you want it done.&amp;nbsp; Take things further, and your own software is yours, giving you real freedom over how you use your computer.&amp;nbsp; Feel free to ask me if you're interested in getting started and I can try to point you in the right direction and give you some help!&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://feeds.feedburner.com/nowwetryitmyway" rel="alternate" type="application/rss+xml"&gt;&lt;img alt="" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" style="border: 0; vertical-align: middle;" /&gt;&lt;/a&gt;&amp;nbsp;&lt;a href="http://feeds.feedburner.com/nowwetryitmyway" rel="alternate" type="application/rss+xml"&gt;Subscribe to NowWeTryItMyWay&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; &lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/nowwetryitmyway/~4/CnomlkGCFfA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/nowwetryitmyway/~3/CnomlkGCFfA/making-computers-really-work.html</link><author>noreply@blogger.com (Jack Preston)</author><thr:total>0</thr:total><georss:featurename>Cambridge, UK</georss:featurename><georss:point>52.2025441 0.1312368</georss:point><georss:box>52.1636181 0.05227279999999998 52.241470099999994 0.2102008</georss:box><feedburner:origLink>http://nowwetryitmyway.blogspot.com/2011/11/making-computers-really-work.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7385891077026730373.post-6484786666515537706</guid><pubDate>Tue, 29 Nov 2011 00:25:00 +0000</pubDate><atom:updated>2012-01-02T08:13:52.960-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">culture</category><category domain="http://www.blogger.com/atom/ns#">iain banks</category><category domain="http://www.blogger.com/atom/ns#">iain m banks</category><title>So Let's Begin...</title><description>&lt;span style="font-family: arial;"&gt;Like however many countless thousands  already started out there, this blog's been started pretty much entirely  on a late-night whim with no discernible theme or focus.&amp;nbsp; Hopefully  it'll make it to the heady heights of at least two entries, which I'm  pretty sure is more than the majority of those...&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: arial;"&gt;I'm completely new to the entire world  of blogging (only, what, like a decade late?); I have no idea what's  going on, who to watch, or what people expect from things here, so I'm  very open to your comments, and happy to chat to anyone friendly enough  to want to :D.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: arial;"&gt;As far as the name goes, I'm a very  big fan of the books of one Iain M Banks, science fiction writer and (as  far as I can tell) all-round lovely man.&amp;nbsp; For those who don't know,  first of all; go read all of his books and have incredible fun, but  secondly; a lot of his novels take place in a huge, anarchist culture  spanning many planets and artificial worlds called the Culture.&amp;nbsp; Among  the most interesting inhabitants of the culture are the vastly powerful  artificially intelligent Minds, primarily those that form the brains of  the Culture's vast spaceships.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: arial;"&gt;Very summary explanation of the  context out of the way, the ships of the Culture tend to choose their  own names, and given both that their immense intelligence tends to lean  toward a kind of cheeky, dry humour, and that they're the creation of a  witty Scottish writer, these names are a favourite quirk of a lot of  Banks's fans.&amp;nbsp; Among my favourites are &lt;/span&gt;&lt;span style="font-family: arial; font-style: italic;"&gt;'Helpless in the Face of Your Beauty&lt;/span&gt;&lt;span style="font-family: arial;"&gt;', &lt;/span&gt;&lt;span style="font-family: arial; font-style: italic;"&gt;'Funny, it Worked Last Time...'&lt;/span&gt;&lt;span style="font-family: arial;"&gt; and &lt;/span&gt;&lt;span style="font-family: arial; font-style: italic;"&gt;'Fate Amenable to Change'&lt;/span&gt;&lt;span style="font-family: arial;"&gt;.&amp;nbsp; Another is &lt;/span&gt;&lt;span style="font-family: arial; font-style: italic;"&gt;'Now we Try it My Way'&lt;/span&gt;&lt;span style="font-family: arial;"&gt;.&amp;nbsp; See &lt;/span&gt;&lt;span style="font-family: arial; text-decoration: underline;"&gt;&lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/List_of_culture_ships" style="font-family: arial;"&gt;here&lt;/a&gt;&lt;span style="font-family: arial;"&gt;  for a list of the greats. Most likely stay tuned for much more in-depth  talk about Banks's novels in future, get reading before then so you  know what I'm on about!&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: arial;"&gt;Well, I'll sign off for now; like I  say, if by some random chance (I don't know how this might happen  really, but who knows...) you're reading this as a stranger, leave a  comment and I'll say 'ello :D&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: arial;"&gt;&lt;a href="http://feeds.feedburner.com/nowwetryitmyway" rel="alternate" type="application/rss+xml"&gt;&lt;img alt="" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" style="border: 0; vertical-align: middle;" /&gt;&lt;/a&gt;&amp;nbsp;&lt;a href="http://feeds.feedburner.com/nowwetryitmyway" rel="alternate" type="application/rss+xml"&gt;Subscribe to NowWeTryItMyWay&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: arial;"&gt;&amp;nbsp; &lt;/span&gt;&lt;img src="http://feeds.feedburner.com/~r/nowwetryitmyway/~4/dGl9Kh-7Q3E" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/nowwetryitmyway/~3/dGl9Kh-7Q3E/so-lets-begin.html</link><author>noreply@blogger.com (Jack Preston)</author><thr:total>0</thr:total><georss:featurename>Cambridge, UK</georss:featurename><georss:point>52.2025441 0.1312368</georss:point><georss:box>52.1636181 0.05227279999999998 52.241470099999994 0.2102008</georss:box><feedburner:origLink>http://nowwetryitmyway.blogspot.com/2011/11/so-lets-begin.html</feedburner:origLink></item></channel></rss>
