Top.Mail.Ru
Python
? ?
LiveJournal for python.
View:Personal Journal.
View:Friends.
View:Calendar.
Missed some entries? Then simply jump to the previous day or the next day.

Tuesday, June 11th, 2002

Time:9:30 pm.
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
	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.
Comments: Read 6 orAdd Your Own.

LiveJournal for python.

View:User Info.
View:Friends.
View:Calendar.
View:Memories.
Missed some entries? Then simply jump to the previous day or the next day.

Image