<br><br><div><span class="gmail_quote">On 26/03/2008, <b class="gmail_sendername">Gloom Demon</b> &lt;<a href="mailto:gloomdemon@gmail.com">gloomdemon@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;">
Hello :-)<br><br>Example (cost of something in different countries by different years)<br>
<br>Record1&nbsp;US&nbsp;2006&nbsp;22.10<br>Record2 US 2007 23.45<br>Record3 UK 2007 22.90<br>..................................<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://mail.python.org/mailman/listinfo/tutor" target="_blank"></a><br>

<br></blockquote></div><br clear="all">In Python a list is similiar to an array in Pascal.<br>You define a list like this: my_list = [1, 2, 3, 4]<br><br>However I dont think you want an array here, if I was doing something like this I would use a dictionary. A dictionary stores keys and values.<br>
So you could do something like this:<br><br>records = {&#39;US&#39;: {&#39;2007&#39;: 22.5, &#39;2008&#39;: 44.8}, &#39;UK&#39;: {&#39;2008&#39;: 3.4, &#39;2007&#39;: 2.6}}<br><br>You can now access a particular record as follows:<br>
<br>In: print records[&#39;UK&#39;][&#39;2007&#39;]<br>Out: 2.6<br><br>Regards,<br>-- <br>Michael Connors<br>