[Tutor] x and y

elis aeris hunter92383 at gmail.com
Sat Mar 22 23:50:56 CET 2008


I just need a way to key a list of tuples of 2 for referencing.




On Sat, Mar 22, 2008 at 3:48 PM, Alan Gauld <alan.gauld at btinternet.com>
wrote:

>
> "elis aeris" <hunter92383 at gmail.com> wrote
>
> > on a different note, also on lists,  I need to save two values, x
> > and y.
> >
> > list = { int, int
> >           int, int
> >           int, int
> >
> > but i am not sure of the syntax, is it possible to just read both
> > values
> > from the same entry in the list ?
>
> I have no idea what you mean by that, can you give a more
> specific example?
>
> Are you trying to extract 2 values out of a list into variables?
> Are you trying to save two variable values into a list?
>
> And what kind of list is your example?
> It uses a built in function(list) to refer to something that looks
> like a cross between a dictionary and an open list but filled
> with the same value (or another built in function?)
>
> Can you try using a Python example with real values and tell
> us what you want to dowith them. (And try it at the >>> prompt
> first, since the most obvious solution is often the right one in
> Python!)
>
> HTH,
>
> --
> Alan Gauld
> Author of the Learn to Program web site
> http://www.freenetpages.co.uk/hp/alan.gauld
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20080322/6f80970b/attachment-0001.htm 


More information about the Tutor mailing list