Tabnanny?
John Roth
newsgroups at jhrothjr.com
Wed Jun 8 20:36:18 EDT 2005
"Anna M." <anna-s at internet.is> wrote in message
news:mailman.148.1118274251.10512.python-list at python.org...
> Thank you so much
> and so it goes . . .
>
> from random import randint
>
> def idxLargest(list, n):
> idxMx = 0
>
> for i in range(1, n, 1):
>
> if list[i] > list[idxMx]:
> idxMx = i
>
> return idxMx
>
>
> def radixSort(data):
> sorting = [data]
> tmp = []
>
> for i in range(10):
> tmp.append([])
>
> idx = idxLargest(data, len(data) <<<===== needs end parenthesis
========= missing ) ========x
> max = data[idx]
> passes = len(max) + 1
>
> for i in range(1, passes + 1, 1):
> sorter = tmp
>
> for bucket in sorting:
>
> for next in bucket:
> nr = next%(10**i)
> radix = (nr/10**(i-1))
> sorter[radix].append(next)
>
> sorting = sorter
> return sorting
>
> n = 10
> a = 0
> b = 200
> test = []
> for i in range(n):
> test.append(randint(a,b))
>
> print test
> test = radixsort(test)
> print test
>
>
>
>>Hi Anna !
>>
>>Please post your code, so we can take a look to see what is happening.
>>
>>See ya !
>>
>>Em Quarta 08 Junho 2005 23:36, Anna M. escreveu:
>>> Hello, i am very new to this. Only heard of python a week ago and have
>>> never posted before anywhere. But I am trying to rewrite a program that
>>I
>>> made in C++ in Python, a radixSort I did as a school project. I get a
>>> Tabnanny Tokenizing Error that says Token Error: EOF in multi-line
>>> statement. I gather from the internet that it means I have a tab-error.
>>I
>>> just can't seem to find it. Is this something you can help me with?
>>Could
>>> I post my code here and you could look at it or is that a bit to much ;)
>>>
>>> Many thanks,
>>>
>>> Anna
>
> --
> Douglas Soares de Andrade
> http://douglasandrade.cjb.net - dsa at unilestemg.br
> UnilesteMG - www.unilestemg.br
> ICQ, MSN = 76277921, douglas at tuxfamily.org
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
More information about the Python-list
mailing list