Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Mark Lawrence Newsgroups: comp.lang.python Subject: Re: Nested List question Date: Wed, 24 Feb 2016 21:38:09 +0000 Lines: 32 Message-ID: References: <4AD2810BE3B346399F777EDEAB079BDA@OPTIPLEX990> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de U7skjBsXTHNtIKOReasUuQKBM/IE5FVrxSpnWOMskwzA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'elements.': 0.05; 'from:addr:yahoo.co.uk': 0.05; 'subject:question': 0.08; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'nest': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'language': 0.19; 'all,': 0.20; 'lawrence': 0.22; 'tried': 0.24; 'words': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'figure': 0.27; 'that.': 0.30; "i'd": 0.31; 'language.': 0.32; 'subject:List': 0.33; 'correctly': 0.34; 'structure': 0.34; 'list': 0.34; 'could': 0.35; 'park': 0.35; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'thanks': 0.37; 'received:org': 0.37; 'list.': 0.37; 'several': 0.38; 'goes': 0.39; 'data': 0.39; 'to:addr:python.org': 0.40; 'mark': 0.40; 'your': 0.60; 'charset:windows-1252': 0.62; 'our': 0.64; 'application?': 0.84; 'avenue.': 0.84; 'pythonistas,': 0.84; 'broadway': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: 80.234.182.166 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: <4AD2810BE3B346399F777EDEAB079BDA@OPTIPLEX990> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:103465 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