Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #49659 > unrolled thread

Re: how to calculate reputation

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2013-07-02 15:59 -0600
Last post2013-07-02 15:59 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: how to calculate reputation Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-02 15:59 -0600

#49659 — Re: how to calculate reputation

FromIan Kelly <ian.g.kelly@gmail.com>
Date2013-07-02 15:59 -0600
SubjectRe: how to calculate reputation
Message-ID<mailman.4128.1372802411.3114.python-list@python.org>
On Tue, Jul 2, 2013 at 3:43 PM, Surya Kasturi <suryak@ieee.org> 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.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web