Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #103465

Re: Nested List question

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Newsgroups comp.lang.python
Subject Re: Nested List question
Date 2016-02-24 21:38 +0000
Message-ID <mailman.108.1456349924.20994.python-list@python.org> (permalink)
References <4AD2810BE3B346399F777EDEAB079BDA@OPTIPLEX990>

Show all headers | View raw


On 24/02/2016 20:59, grsmith@atlanticbb.net wrote:
> All,
>
> Can you have a phython list like:
> ['George',
> 'Soros',
> ['99 First Street',
>    '33 Broadway Avenue', ['Apt 303'],
>    '1 Park Avenue'],
>    'New York', 'NY']
>
> In other words how do you correctly nest the
> ['Apt 303'] so it goes with 33 Broadway Avenue.
>
> Also, I tried several ways and could not figure out
> how to get the ['Apt 303'] out of the list. How can
> you do that. It is the ['Apt 303'] that is the problem,
> I know how to do the other elements.
>
> thanks
> George
>

As you've all ready had answers, I'd simply ask is a list the best data 
structure for your application?

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Nested List question Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-02-24 21:38 +0000

csiph-web