Alright this code is actually littered with bugs, but don't feel bad, because as you state you are new to the whole programming thing. I'll try to explain the things i see going wrong (please take into account that i'm also a new pythonist ;-))
<br><br>***<br>You get the error &#39;variable undefined&#39; because you are declaring a global in an incorrect manner. The correct manner is to define the variable in the global scope then start a definition, declare that you are using a global variable and then assign it. Like this :
<br><br>bla = &#39;Hello world&#39;<br><br>def func():<br>&nbsp;&nbsp;&nbsp; global bla<br>&nbsp;&nbsp;&nbsp; print bla<br>***<br>If you do :<br>
porao = raw_input()<br>
You&#39;ll define the integer value as a string, not an integer. If you are
sure that only an integer will be entered use input() (slower) or
int(raw_input()). In either case you should use try and except clauses
more in your code because if not a 1 or 4 is entered your code will
continue without having the variables declared! Leading to other errors.<br>***<br>Now suppose you get the definitions using globals correct then you&#39;ll get new errors stating that an &#39;int&#39; is not callable.<br>
This happens because you define for example altura as an integer and then also define a function called altura. If you now use :<br>altura()<br>It&#39;ll try to call the integer object and will fail.<br>Easy solution would be to make the function something like alturadef()
<br>***<br>As for your identation you should use consistent identation... I suggest using python -t or python -tt to compile your script and it will give warnings/errors where the identation goes wrong.<br>***<br>Here&#39;s how i altered your code (quick and dirty probably, it should be more clean using try and except clauses and what not) to get it to work but you can probably better look that up in a python book and then return to the list if you don&#39;t understand it :
<br><br>#Ok,this is supposed to be a 2 option choice between values 1 and 4,<br>#i want the value to determine the variable values inside the function<br><br>altura_aeronave = 0<br>largura_aeronave = 0<br>comprimento_aeronave = 0
<br>comprimento = 0 <br>largura = 0<br>altura = 0<br><br>def porao():<br>&nbsp;&nbsp;&nbsp; global altura_aeronave, largura_aeronave, comprimento<br>&nbsp;&nbsp;&nbsp; porao = input()<br>&nbsp;&nbsp;&nbsp; if porao == 1 :<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; altura_aeronave = 111<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; largura_aeronave = 112
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; comprimento = 211<br>&nbsp;&nbsp;&nbsp; elif porao == 4:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; altura_aeronave = 112<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; largura_aeronave = 113<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; comprimento = 212<br>&nbsp;&nbsp;&nbsp; else:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;Porão inexistente&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<br>#These three functions were supposed to get input from user so it can be compared<br>#with the values determinated(determined?)above<br>def larguradef():<br>&nbsp;&nbsp;&nbsp; global largura<br>&nbsp;&nbsp;&nbsp; largura=input()<br><br>def alturadef():
<br>&nbsp;&nbsp;&nbsp; global altura<br>&nbsp;&nbsp;&nbsp; altura=input()<br><br>def comprimentodef():<br>&nbsp;&nbsp;&nbsp; global comprimento<br>&nbsp;&nbsp;&nbsp; comprimento = input()<br>&nbsp;&nbsp;&nbsp; <br>#These are the comparison functions<br>def largura_compativel ():<br>&nbsp;&nbsp;&nbsp; global largura, largura_aeronave
<br>&nbsp;&nbsp;&nbsp; if not largura &lt;= largura_aeronave:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &#39;Volume largo demais!&#39;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>def altura_compativel ():<br>&nbsp;&nbsp;&nbsp; global altura, altura_aeronave<br>&nbsp;&nbsp;&nbsp; if not altura &lt;= altura_aeronave:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &#39;Volume alto demais!&#39;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>def comprimento_compativel ():<br>&nbsp;&nbsp;&nbsp; global comprimento, comprimento_aeronave<br>&nbsp;&nbsp;&nbsp; if not comprimento&lt;=comprimento_aeronave:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &#39;Volume comprido demais!&#39;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>#Try to run this damn thing,man!!!!!1<br>porao()<br>#print altura_aeronave, largura_aeronave, comprimento<br>larguradef()<br>alturadef()<br>comprimentodef()<br>largura_compativel()<br>altura_compativel<br>
comprimento_compativel()<br><br><br><br><br><br><br><br><br><div><span class="gmail_quote">On 1/19/07, <b class="gmail_sendername">Karl Wittgenstein</b> &lt;<a href="mailto:miago.python@gmail.com">miago.python@gmail.com</a>
&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Dear Smart Caring Dude,</div>
<div>I&#39;ve been dabbling into Python for about 6 weeks now.I&#39;m a Social Sciences student who just got interested in programming and chose Python as first language.I&nbsp;have little time to practice and I am just getting into&nbsp; programming concepts,so please be patient,in case you are so kind as to enlighten this poor soul.
</div>
<div>I am trying to write this program which should compare values that are set by the program&nbsp;&nbsp;through user&#39;s choice to values that the user enters on a prompt.I use SPE on windows xp,and it tells me that there are indentation erros on the 
definitions.Isn&#39;t it legal to start a new block of code when starting a definition?And how come it returns &#39;variable&#39; not defined,when they are defined by the = ??Should i make them global?</div>
<div>I would be very grateful to the patient soul that answers these questions,as my learning interest is sincere and the knowledge sources so disperse.</div>
<div>Here goes the code:</div>
<div>&nbsp;</div>
<div>#Ok,this is supposed to be a 2 option choice between values 1 and 4,<br>#i want the value to determine the variable values inside the function<br>def porao():<br>&nbsp;&nbsp;&nbsp; porao = raw_input()<br>&nbsp;&nbsp;&nbsp; if porao == 1 :<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; global altura_aeronave = 111
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; global largura_aeronave = 112<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; global comprimento = 211<br>&nbsp;&nbsp;&nbsp; elif porao == 4:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; global altura_aeronave = 112<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; global largura_aeronave = 113<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; global comprimento = 212<br>&nbsp;&nbsp;&nbsp; else:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;Porão inexistente&quot;<br>#These three functions were supposed to get input from user so it can be compared <br>#with the values determinated(determined?)above<br>def largura():<br>&nbsp;&nbsp; global largura=input()
<br>def altura():<br>&nbsp;&nbsp; global altura=input()<br>def comprimento():<br>&nbsp;&nbsp; global comprimento = input()<br>#These are the comparison functions<br>def largura_compativel ():<br>&nbsp;&nbsp;&nbsp; if not largura &lt;= largura_aeronave:<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &#39;Volume largo demais!&#39;<br>def altura_compativel ():<br>&nbsp;&nbsp;&nbsp; if not altura &lt;= altura_aeronave:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &#39;Volume alto demais!&#39;<br>def comprimento_compativel ():<br>&nbsp;&nbsp;&nbsp; if not comprimento&lt;=comprimento_aeronave:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &#39;Volume comprido demais!&#39;<br>#Try to run this damn thing,man!!!!!1<br>porao()<br>largura()<br>altura()<br>comprimento()<br>largura_compativel()<br>altura_compativel<br>comprimento_compativel()<br>

&nbsp;</div>

<br>_______________________________________________<br>Tutor maillist &nbsp;- &nbsp;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Tutor@python.org">Tutor@python.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">
http://mail.python.org/mailman/listinfo/tutor</a><br><br><br></blockquote></div><br>