Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #33512
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'string.': 0.04; 'subject:Python': 0.05; 'things.': 0.05; 'key.': 0.07; 'immutable': 0.09; 'integers': 0.09; 'mutable': 0.09; 'structure,': 0.09; 'tuple': 0.09; '*you*': 0.16; 'altered': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'roy': 0.16; 'sorts': 0.16; 'then...': 0.16; 'values:': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'example.': 0.17; '>>>': 0.18; 'received:209.85.214.174': 0.21; 'subject:Questions': 0.22; "i've": 0.23; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; '(such': 0.27; 'message-id:@mail.gmail.com': 0.27; 'this?': 0.28; "d'aprano": 0.29; 'dictionary': 0.29; 'steven': 0.29; 'covered': 0.29; 'keyword': 0.30; 'lists': 0.31; 'consist': 0.33; 'ordered': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'list': 0.35; 'needed': 0.35; 'nov': 0.35; 'received:209.85': 0.35; 'list.': 0.35; 'created': 0.36; 'but': 0.36; '(i.e.': 0.36; 'one,': 0.37; 'does': 0.37; 'two': 0.37; 'being': 0.37; 'previous': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'header:Received:5': 0.40; 'hearing': 0.61; 'on...': 0.65; 'phone': 0.68; 'smith': 0.71; 'prisoner': 0.84; 'subject:Interview': 0.84; 'many,': 0.93 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=M63kqpoassgBxO3eXj8eHAPNgKD8a7SeTyWC8yOVuV4=; b=IvOvRADEYzm5UalEoL6cOKTF23yk7Unsol/VELqti4Jb18u2jLog+FJQO2gXmpRWs1 Kuf8FunWvUyGzXgJxYftSFq0MINRaCrDJWJTeaHg5IkMEb/HLe3pwi/IoBCSJVYjAZMp t3TzswYtVfbNSXYsLv2z09JOApfXtfhGCwY8kXqwwHq0I7PHtHdB41Cu+uKw69hY5qxI dkc4cslmDGhRoQwN8w/jXDotAHtFVpJTLhJJ7n+eSg+hB0WURkl8RThnUekUH7afK8UD 2i+Xz0IKkncTL5e01tLFGFTdVQSId99LSmfxVIgAa4HqOZYLoUeXCIjQDd8f2zfms3Ei owfQ== |
| MIME-Version | 1.0 |
| In-Reply-To | <20121118121614.24d2416d@dilbert> |
| References | <1193768041.349129.26350@v3g2000hsg.googlegroups.com> <55443eb7-847c-4f4c-8d04-1e6b507aac00@googlegroups.com> <50a8acdc$0$29978$c3e8da3$5496439d@news.astraweb.com> <roy-EFE1F1.08532518112012@news.panix.com> <50a911ec$0$29978$c3e8da3$5496439d@news.astraweb.com> <20121118121614.24d2416d@dilbert> |
| Date | Mon, 19 Nov 2012 07:02:49 +1100 |
| Subject | Re: Python Interview Questions |
| From | Chris Angelico <rosuav@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3799.1353268978.27098.python-list@python.org> (permalink) |
| Lines | 26 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1353268978 news.xs4all.nl 6933 [2001:888:2000:d::a6]:40469 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:33512 |
Show key headers only | View raw
On Mon, Nov 19, 2012 at 4:16 AM, D'Arcy J.M. Cain <darcy@druid.net> wrote:
> On 18 Nov 2012 16:50:52 GMT
> Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote:
>> On Sun, 18 Nov 2012 08:53:25 -0500, Roy Smith wrote:
>>> > Use a list when you need an ordered collection which is mutable
>> > (i.e. can be altered after being created). Use a tuple when you
>> > need an immutable list (such as for a dictionary key).
>>
>> I keep hearing about this last one, but I wonder... who *actually*
>> does this? I've created many, many lists over the years -- lists of
>> names, lists of phone numbers, lists of directory search paths, all
>> sorts of things. I've never needed to use one as a dictionary key.
>
> Well, as long as *you* never needed it then...
>
> CellBlock = 9 # There's a riot going on...
> Cell = 17
> Bunk = "top"
>
> Prisoner = {(CellBlock, Cell, Bunk): "Bernie Madoff"}
That's a structure, not a list. Every key will consist of precisely
three values: two integers and one keyword string. Already covered by
a previous example.
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: Python Interview Questions chinjannisha@gmail.com - 2012-11-17 10:01 -0800
Re: Python Interview Questions Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-11-18 01:54 -0500
Re: Python Interview Questions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-18 09:39 +0000
Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-11-18 08:53 -0500
Re: Python Interview Questions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-18 16:50 +0000
Re: Python Interview Questions "D'Arcy J.M. Cain" <darcy@druid.net> - 2012-11-18 12:16 -0500
Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-11-18 12:53 -0500
Re: Python Interview Questions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-19 00:31 +0000
Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-11-18 21:09 -0500
Re: Python Interview Questions Chris Angelico <rosuav@gmail.com> - 2012-11-19 13:18 +1100
Re: Python Interview Questions Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-11-19 02:42 +0000
Re: Python Interview Questions Ian Kelly <ian.g.kelly@gmail.com> - 2012-11-18 23:01 -0700
Re: Python Interview Questions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-19 07:54 +0000
Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-11-19 09:30 -0500
Re: Python Interview Questions Ian Kelly <ian.g.kelly@gmail.com> - 2012-11-19 09:44 -0700
Re: Python Interview Questions Terry Reedy <tjreedy@udel.edu> - 2012-11-19 15:41 -0500
Re: Python Interview Questions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-19 23:42 +0000
Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-11-19 21:33 -0500
Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-11-19 09:59 -0500
Re: Python Interview Questions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-19 23:53 +0000
Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-11-19 22:14 -0500
RE: Python Interview Questions "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-11-19 23:57 +0000
Re: Python Interview Questions Terry Reedy <tjreedy@udel.edu> - 2012-11-19 03:27 -0500
Re: Python Interview Questions Chris Angelico <rosuav@gmail.com> - 2012-11-19 07:02 +1100
csiph-web