View Single Post
Old May 23rd, 2006, 11:59 AM   #128
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Use the len function to find out how long a list is. e.g.
len(highlights) == 1
(You can also do len(x) == 0, which is equivalent to x == [])

Or, you could do it thus:
if highlights == []:
    # highlights doesn't exist
else:
    # highlights does exist
Look up the difference between "else" and "elif".
Arevos is offline   Reply With Quote