<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 2, 2013 at 11:59 PM, Tobiah <span dir="ltr"><<a href="mailto:toby@tobiah.org" target="_blank">toby@tobiah.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 07/02/2013 02:43 PM, Surya Kasturi wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hi all, this seems to be quite stupid question but I am "confused"..<br>
We set the initial value to 0, +1 for up-vote and -1 for down-vote! nice.<br>
<br>
I have a list of bool values True, False (True for up vote, False for down-vote).. submitted by users.<br>
<br>
[True, False, False, True....]<br>
<br>
Now to calculate the total reputation<br>
<br>
should I take True = +1, False=0  [or] True = +1, False=-1 ?? for adding all.<br>
<br></div><div class="im">
I am missing something here.. and that's clear.. anyone please help me on it?<br>
<br></div>
Thanks<br>
<br>
<br>
<br>
</blockquote>
<br>
for vote in bool_votes:<br>
        <br>
        reputation += 2 * vote - 1<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
Tobiah<br>
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/<u></u>mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br></div><div class="gmail_extra"><br></div><div class="gmail_extra" style>I think I didnt explain it clearly.. let me make it clear..</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>

1. The database we are using is having BooleanField for it!! so, cant do anything</div><div class="gmail_extra" style>2. I am not looking for sorting algorithms .. just simple math :) It sounds crazy but let me describe my confusion</div>

<div class="gmail_extra" style><br></div><div class="gmail_extra" style>lets have 3 users with </div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>[null, null, null] </div><div class="gmail_extra" style>

reputation = 0</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>[T, - - ]</div><div class="gmail_extra" style>rept = 1</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>

[T T T]</div><div class="gmail_extra" style>rept = 3</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>[T T F]</div><div class="gmail_extra" style>rept = 1 (its jumping from 3 to 1 -->but generally, we observe only decrease in 1 right?)</div>

<div class="gmail_extra" style><br></div><div class="gmail_extra" style>[T T F]</div><div class="gmail_extra" style>rept = 3 (its jumping from 1 to 3)</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>

These jumpings are common? or my logic is going any wrong?</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style><br></div></div>