Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.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.065 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'true,': 0.05; 'false,': 0.09; '-1,': 0.16; '-1.': 0.16; 'bool': 0.16; 'all.': 0.16; 'wrote:': 0.18; 'users.': 0.18; 'all,': 0.19; 'seems': 0.21; 'initial': 0.24; 'question': 0.24; 'values': 0.27; 'header:In- Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'quite': 0.32; 'but': 0.35; 'received:google.com': 0.35; 'false': 0.36; 'should': 0.36; 'list': 0.37; 'represent': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'worry': 0.60; 'conversion': 0.61; "you're": 0.61; 'total': 0.65; 'jul': 0.74; 'step.': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=TpJYidxA2n/83bFZCNe495CDMmEXv2QTRb7rxcIu+Uw=; b=QFRtxv3Dv+rsyWEmDGl7DsUfVWFlCiMtymoUR/2fU90Acm6unqnPORb6KFAa5TNRpq gRU6fQkxbq98gZyvtN/+NKIqAgARRtP+OfBSVPchDPDHuzNpesbaCeXVfAt4tjdrJF5K 7A0zOwNHfoUG+PodSCS722TjaZHPG6DVQJb3uFofpGck7l00z13bIkWgVBn6Fmht9hkv QLosQCUl9qKl024NAq/KHf6dDDpBRBdKJBk+c1d6knuPPcL+jm+T0RQiJ1xGd8HacnUN fdVD7Fg5zDedWOszDKOCrPcjVu6QaJhLy5ApdYKGfpyI7B1qpF80CF6iTiNcVB3YDjt0 omUw== X-Received: by 10.68.217.7 with SMTP id ou7mr31087798pbc.8.1372802402102; Tue, 02 Jul 2013 15:00:02 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Tue, 2 Jul 2013 15:59:21 -0600 Subject: Re: how to calculate reputation To: Python 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1372802411 news.xs4all.nl 15986 [2001:888:2000:d::a6]:50798 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:49659 On Tue, Jul 2, 2013 at 3:43 PM, Surya Kasturi wrote: > Hi all, this seems to be quite stupid question but I am "confused".. > We set the initial value to 0, +1 for up-vote and -1 for down-vote! nice. > > I have a list of bool values True, False (True for up vote, False for > down-vote).. submitted by users. > > [True, False, False, True....] > > Now to calculate the total reputation > > should I take True = +1, False=0 [or] True = +1, False=-1 ?? for adding > all. You're using False to represent a down-vote and you want down-votes to count as -1, so you would count a False value as -1. Now why don't you just use 1 and -1 to represent the votes instead of True and False? Then you won't need to worry about this conversion step.