<div>First of all let me thank you and Geoframer for your patience;it was very kind that you bothered answering this,as I realize this is very basic stuff.You people are Smart and Caring Dudes,which is a powerful combo for educators!!
</div>
<div>&nbsp;</div>
<div>&quot;Out of curiosity, what materials are you using to learn how to program?&quot;</div>
<div>&nbsp;</div>
<div>Well, mostly Google! I have just finished that RUR-PLE tutorial by Andre Roberge, read some of the Python documentation-not as focused as I should,I admit;many programming concepts are simply&nbsp; totally alien to me,so I also use Wikipedia a 
lot.They have a Python tutorial.Sometimes&nbsp;I do some math research, as I only know very basic math,predicate logic and&nbsp;statistics.I also tried a pygame tutorial,but can&#39;t import the damn module without at least one error and can&#39;t get the damn 
chimp.bmp file loaded!!!I used os.path.join(&quot;folder&quot;,&quot;file&quot;) to no success...</div>
<div>Thank you again,and once more in advance - if you would be so kind as to point me learning material...My spare time is very short,between graduation and work,so I would appreciate very didatic material...Thank you guys again!
<br><br>&nbsp;</div>
<div><span class="gmail_quote">2007/1/19, Danny Yoo &lt;<a href="mailto:dyoo@hkn.eecs.berkeley.edu">dyoo@hkn.eecs.berkeley.edu</a>&gt;:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>&gt; I&#39;ve been dabbling into Python for about 6 weeks now.I&#39;m a Social<br>&gt; Sciences student who just got interested in programming and chose Python
<br>&gt; as first language.<br><br>Out of curiosity, what materials are you using to learn how to program?<br><br><br><br>&gt; Isn&#39;t it legal to start a new block of code when starting a<br>&gt; definition?And how come it returns &#39;variable&#39; not defined,when they are
<br>&gt; defined by the = ??Should i make them global?<br><br>Wait, wait.&nbsp;&nbsp;I think you may be misunderstanding the use of &#39;global&#39;.<br>You should not be using global unless you really need it.<br><br><br><br>I see three variables here that you are interested in:
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;altura_aeronave<br>&nbsp;&nbsp;&nbsp;&nbsp;largura_aeronave<br>&nbsp;&nbsp;&nbsp;&nbsp;comprimento<br><br>Are these always collected together?&nbsp;&nbsp;If they are related, you should have<br>a single structure that holds them together, rather than represent them as
<br>three separate variables.<br><br><br>Concretely, you can represent these three values as a single tuple.&nbsp;&nbsp;You<br>can think of it as a &quot;vector&quot; from your mathematics class.&nbsp;&nbsp;For example:<br><br>#################################################
<br>def make_measure(start, stop):<br>&nbsp;&nbsp;&nbsp;&nbsp;&quot;&quot;&quot;make_measure: number number -&gt; measure<br>&nbsp;&nbsp;&nbsp;&nbsp;Creates a new measure from start and stop.&quot;&quot;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;return (start, stop)<br><br>def measure_start(a_measure):
<br>&nbsp;&nbsp;&nbsp;&nbsp;&quot;&quot;&quot;measure_start: measure -&gt; number<br>&nbsp;&nbsp;&nbsp;&nbsp;Selects the start portion of a measure.&quot;&quot;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;return a_measure[0]<br><br>def measure_stop(a_measure):<br>&nbsp;&nbsp;&nbsp;&nbsp;&quot;&quot;&quot;measure_end: measure -&gt; end
<br>&nbsp;&nbsp;&nbsp;&nbsp;Selects the stop portion of a measure.&quot;&quot;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;return a_measure[1]<br>#################################################<br><br><br>That is, these functions take inputs and produce outputs.&nbsp;&nbsp;That should be
<br>a concept that you are familiar with from your previous experience:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;f(x) = 2x&nbsp;&nbsp;&nbsp;&nbsp; (math notation)<br><br>is a function that takes a number and produces the double of that number.<br>We write this in Python as:
<br><br>################<br>def double(x):<br>&nbsp;&nbsp;&nbsp;&nbsp;&quot;&quot;&quot;double: number -&gt; number<br>&nbsp;&nbsp;&nbsp;&nbsp;Returns the double of x.&quot;&quot;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;return x * 2<br>################<br><br><br>Getting back to the measure example: once we have these functions to build
<br>measures and take them apart, we can then use these like this:<br><br>################################################<br>## Small test program<br>m1 = make_measure(3, 4)<br>m2 = make_measure(17, 42)<br>print &quot;m1&quot;, measure_start(m1), measure_stop(m1)
<br>print &quot;m2&quot;, measure_start(m2), measure_stop(m2)<br>################################################<br><br>If we dislike the duplication of those last two statements here, we can<br>create a function that doesn&#39;t produce an output, but it still takes
<br>input:<br><br><br>########################################################################<br>def print_measure(header_name, a_measure):<br>&nbsp;&nbsp;&nbsp;&nbsp;&quot;&quot;&quot;print_measure: measure string -&gt; None<br>&nbsp;&nbsp;&nbsp;&nbsp;Prints out the measurement.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&quot;&quot;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;print header_name, measure_start(a_measure), measure_stop(a_measure)<br>########################################################################<br><br><br>After we define this helper function &quot;print_measure()&quot;, our little program
<br>can now look like this:<br><br>#########################<br>## Small test program<br>m1 = make_measure(3, 4)<br>m2 = make_measure(17, 42)<br>print_measure(&quot;m1&quot;, m1)<br>print_measure(&quot;m2&quot;, m2)<br>#########################
<br><br>Notice that, here, we do not need to say anything about &quot;globals&quot; to make<br>effective programs.&nbsp;&nbsp;We are simply passing values back and forth as<br>parameters.<br><br><br>Does this make sense so far?&nbsp;&nbsp;If you have any questions, please feel free
<br>to ask.&nbsp;&nbsp;Please continue to reply to Tutor by using your email client&#39;s<br>Reply to All feature.<br></blockquote></div><br>