i keep getting
Traceback (most recent call last):
File "sort.py", line 21, in ?
main()
File "sort.py", line 12, in main
if names[a][0] == 'g':
IndexError: string index out of range
on this code
the elif works fine
it basicly searches a list for each item starting with b or g. at least i think thats what it does : )
any help?
i hope if people don't mind if i post questions like this. i think everyone could benifit from a place to post code they don't understand.
Traceback (most recent call last):
File "sort.py", line 21, in ?
main()
File "sort.py", line 12, in main
if names[a][0] == 'g':
IndexError: string index out of range
on this code
the elif works fine
for a in range(len(names)): if names[a][0] == 'g': groups.append(str(a)) elif names[a][0] == 'b': print names[a]
it basicly searches a list for each item starting with b or g. at least i think thats what it does : )
any help?
i hope if people don't mind if i post questions like this. i think everyone could benifit from a place to post code they don't understand.
