Consistent error

Alister alister.ware at ntlworld.com
Sun Jan 3 13:22:57 EST 2016


On 03/01/16 16:55, cc.fezeribe at gmail.com wrote:
> On Sunday, January 3, 2016 at 5:14:33 PM UTC+1, Chris Angelico wrote:
>> On Mon, Jan 4, 2016 at 2:59 AM,  <cc.fezeribe at gmail.com> wrote:
>>> Thanks Chris!
>>> Don't worry about the indent, will fix it
>>> I've rewritten it to this-
>>>
>>>   def get_algorithm_result( numlist ):
>>>>   largest = numlist[0]
>>>>   i = 1
>>>>   while ( i < len(numlist) ):
>>>       i = i + 1
>>>>     if ( largest < numlist[i]):
>>>>       largest = numlist[i]
>>>>       numlist[i] = numlist[-1]
>>>>       numlist = [1,2,3,4,5]
>>>         return largest
>>>> def prime_number(x):
>>>>   return len([n for n in range(1, x + 1) if x % n == 0]) <= 2
>>>
>>> But it still gives the test_maximum_number_one error.
>>> Please if you have any ideas what else I should change or add, let me know. Thanks!
>>
>> Well, the algorithmic comments I mentioned would still help you to
>> figure out what's going on :)
>>
>> ChrisA
>
>
>
> Thanks Chris!
> You possess great knowledge I'd like to have...
> ... well I'm just a newbie...
>
this is why Criss has given you an indication on where to start with 
debugging your code.
Had he simply given you corrected code you would not necessarily learn why.
you learn much ore when things go wrong & you fix them that you ever 
will buy simply having correct code.



More information about the Python-list mailing list