how to calculate reputation

Tobiah toby at tobiah.org
Tue Jul 2 17:59:38 EDT 2013


On 07/02/2013 02: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.
>
> I am missing something here.. and that's clear.. anyone please help me on it?
>
> Thanks
>
>
>

for vote in bool_votes:
	
	reputation += 2 * vote - 1


Tobiah



More information about the Python-list mailing list