* surya k [2011-08-27 20:51]:
>
> here, as the loop goes on, i*j can never become smaller in any case.
> which is why I think it, as long as "PNum" gets a new number, its
> bigger palindrome than the previous.. so, at the end of the loop.
> we'll get largest palindrome number..
>
> On 8/25/11,
surya k wrote:
> If you take a close look at my code.
>
> for i in range (1,100) :
> for j in range (i,100) :
>Temp = palindrome(i*j)
>
> here, as the loop goes on, i*j can never become smaller in any case.
> which is why I think it, as long as "PNum" gets a new number, its
> bigger
On 8/26/2011 8:21 AM Prasad, Ramit said...
if roll[0]> 15:
.
elif roll[0]<=15:<--- this is redundant. already checked for> 15 so if here is
always<= 15
if roll[1]>= 2:
you can change with:
elif roll[1]>= 2:
That is not true. The first one looks at index [0], while the seco
On 8/27/2011 8:21 AM surya k said...
If you take a close look at my code.
for i in range (1,100) :
for j in range (i,100) :
Temp = palindrome(i*j)
here, as the loop goes on, i*j can never become smaller
Of course it can... i=3 * j=90 is less than i=4 * j=4...
Emile
__
If you take a close look at my code.
for i in range (1,100) :
for j in range (i,100) :
Temp = palindrome(i*j)
here, as the loop goes on, i*j can never become smaller in any case.
which is why I think it, as long as "PNum" gets a new number, its
bigger palindrome than the previous.. so,
let me rephrase.
They code say:
If roll[0] >15 :
..
elif roll[0] <= 15:
If the code arrive to the elif, it is for sure <= 15.
Cheers.
Inviato da iPhone
Il giorno 26/ago/2011, alle ore 17:21, "Prasad, Ramit"
ha scritto:
>> if roll[0] > 15:
>>.
>> elif roll[0] <=15: <--