thanks for the reply, btw.<br><br><div class="gmail_quote">On Sun, Mar 23, 2008 at 4:22 PM, Marc Tompkins <<a href="mailto:marc.tompkins@gmail.com">marc.tompkins@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Sun, Mar 23, 2008 at 4:16 PM, elis aeris <<a href="mailto:hunter92383@gmail.com" target="_blank">hunter92383@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
in c++ i use array[n][n] to store things.<br><br>how do i create an array like that?<br></blockquote></div><div><br>Python doesn't have "arrays". It has tuples, lists, and dictionaries. A quick Google will tell you the distinctions between them.<br>
<br>It looks to me like you want to create a list of lists....<br><br><br>t =[ ["item1", "item2", "item3"], ["itemA", "itemB", "itemC"], ["itemI", "itemII", "itemIII"] ]<br>
<br>t[0][0] == "item1"<br>
t[1][1] == "itemB"<br>
t[2][2] == "itemIII"<br>
<br><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c"><br><br><br><br><br><div class="gmail_quote">
On Sun, Mar 23, 2008 at 4:13 PM, bob gailer <<a href="mailto:bgailer@alum.rpi.edu" target="_blank">bgailer@alum.rpi.edu</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>elis aeris wrote:<br>
> t = 12345, 54321, "hello!"<br>
> print t[0]<br>
><br>
> the way the 3 items are saved and access fits my need, now how do I<br>
> make t have more than one entry so effectively I get this?<br>
><br>
> t[n][n]<br>
><br>
</div></div>(1) are you going through the tutorials as requested?<br>
(2) please learn how to ask meaningful questions<br>
For example t[n][n] does not communicate the outcome you desire.<br>
In Python t[n][n] would get you the nth element of the nth element of t.<br>
For example if n were 2 you'd get 3. If that is what you want you just<br>
answered your own question, as a simple test in the Python interactive<br>
window would reveal.<br>
<br>
Otherwise we can only guess as to what you want and that wastes all of<br>
our time!<br>
<br>
It would be far more effective to show us what the result would look<br>
like based on the data you entered into t.<br>
<br>
PLEASE do as much as you can to solve problems yourself and express<br>
questions CLEARLY!<br>
<font color="#888888"><br>
--<br>
Bob Gailer<br>
919-636-4239 Chapel Hill, NC<br>
<br>
</font></blockquote></div><br>
<br></div></div>_______________________________________________<br>
Tutor maillist - <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.fsrtechnologies.com" target="_blank">www.fsrtechnologies.com</a>
</blockquote></div><br>