Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.04; 'terry': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'error:': 0.12; 'am,': 0.14; 'wrote:': 0.14; '6:30': 0.16; 'francesc': 0.16; 'reedy': 0.16; "subject:' ": 0.16; 'traceback': 0.16; '(most': 0.16; 'jan': 0.20; 'work,': 0.20; 'header:In-Reply-To:1': 0.21; 'posting': 0.21; 'example.': 0.23; 'exhibit': 0.23; 'last):': 0.23; '(or': 0.24; 'code': 0.24; 'values': 0.25; 'function': 0.25; "i'm": 0.27; 'needed,': 0.29; 'all,': 0.30; 'second': 0.30; 'offending': 0.30; 'operand': 0.30; 'typeerror:': 0.30; 'done': 0.32; 'header:X-Complaints-To:1': 0.32; 'does': 0.33; 'to:addr :python-list': 0.33; 'lines': 0.33; 'file': 0.34; 'causing': 0.34; 'that,': 0.34; 'header:User-Agent:1': 0.35; 'idea': 0.36; 'problems': 0.36; 'or,': 0.37; 'minimal': 0.37; 'two': 0.37; 'received:org': 0.38; 'problem.': 0.38; 'but': 0.38; 'subject:: ': 0.38; 'some': 0.38; 'case,': 0.39; 'should': 0.39; 'easier': 0.39; 'header:Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'making': 0.67; '100': 0.73; 'summing': 0.84; 'type(s)': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Unsupported operand type(s) for +: 'float' and 'tuple' Date: Fri, 10 Jun 2011 21:44:48 -0400 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: rain.gmane.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 28 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307756701 news.xs4all.nl 49045 [::ffff:82.94.164.166]:56491 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7427 On 6/10/2011 6:30 AM, Francesc Segura wrote: > Hello all, I'm new to this and I'm having problems on summing two > values at python. > > I get the following error: > > Traceback (most recent call last): > File "C:\edge-bc (2).py", line 168, in > if (costGG<= cost + T0): > TypeError: unsupported operand type(s) for +: 'float' and 'tuple' > > I'm working with networkx and my program is this one: [snip about 100 lines] Before posting code that does not work, it is a good idea to reduce to to some minimum needed to exhibit the problem. If you had done that, you may well have found the answer. In this specific case, you should have searched for all lines making assignments to the names causing a problem. This is easier to do by eye with a minimal example. Or, use a search function for 'T0 =' (or 'T0=' if needed, but it is not) with Find Next and the second hit is the offending line ("T0 = initCost*0,1"). -- Terry Jan Reedy