Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.096 X-Spam-Evidence: '*H*': 0.81; '*S*': 0.00; 'subject:not': 0.03; 'happily': 0.16; 'superfluous': 0.16; 'tuple': 0.16; 'tuple,': 0.16; 'tuple.': 0.16; 'tuple;': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'feb': 0.22; '>>>': 0.22; 'print': 0.22; 'header:User- Agent:1': 0.23; 'error': 0.23; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'chris': 0.29; 'am,': 0.29; "doesn't": 0.30; 'subject:list': 0.30; 'code': 0.31; 'comment': 0.34; 'anywhere': 0.35; 'but': 0.35; 'there': 0.35; 'combination': 0.36; "didn't": 0.36; "i'll": 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'course.': 0.60; 'dave': 0.60; 'took': 0.61; "you're": 0.61; 'show': 0.63; 'charset:windows-1252': 0.65; 'received:74.208': 0.68; 'said:': 0.68; '2015': 0.84; 'received:74.208.4.194': 0.84; 'angel': 0.91; 'choice.': 0.93 Date: Tue, 10 Feb 2015 10:51:27 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: TypeError: list indices must be integers, not tuple References: <54DA1573.1030804@davea.name> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:901XNT55UB2aGkT5ZdIJYpDFCkIgYNQg6L6i+4DkJmU z/UVwM1Xo4hOgyX5MzYXBdrrG6+ddacBn2rDmM3Ej5YNsgbJ8w BYzrE2V97ZxBVm1Tg3SELL7rhu0adOXb2xY4IUbsu6uJVzmgba TjvB8RAKMms0TMSN+oopQqL9nUOBL6+K/zJv/QxxyyjfhfOuYy Z9HnO6VjfJrPFok7jGwnPK+MVcnWDUQ/o23YQ8SnZE9sYhVjdX aDRnVWeVOBL3PWgLZIgtqXyKFegVMSACI08yc0qKkN3aEBPecS 3BNEPMKegmMaaTpYMkPqkchncsx1BM3BkpTAwhO76+YIpKn0B1 EVB9FyQkKsZEZCAu0vzA= X-UI-Out-Filterresults: notjunk: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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1423583496 news.xs4all.nl 2898 [2001:888:2000:d::a6]:47704 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:85451 On 02/10/2015 09:33 AM, Chris Angelico wrote: > On Wed, Feb 11, 2015 at 1:28 AM, Dave Angel wrote: >>> If you can show me a one tuple anywhere in the original code I'll >>> happily buy you a tipple of your choice. >> >> >> print Menu[fav,RandomNum] >> >> was in the original code > > That's not a one-tuple (as in, a tuple with one element), it's a > two-element tuple. The point is that ("3") doesn't create a tuple, > it's just superfluous parentheses. You're right of course. I didn't notice the meaning of one-tuple; I took Mark's comment as if he had said: If you can show me a one tuple anywhere ... The original error message said there was a tuple; I knew that fav wasn't the tuple, but the combination of fav and RandomNum was. -- DaveA