On Jun 29, 3:12 am, c0mrade <[EMAIL PROTECTED]> wrote:
> Try something like this...
>
> list = ['lkdfjsldk', None, '', '0', 'slfkjsdlfj', 'lsdgjdlfg', False, True]
> for n, it in enumerate(list):
> if not it: print 'Error on this definition'
> else: print '%d. %s' % (n+1, it)
>
> Results:
>
Ya, I tried your code, it still did the same thing :[. I mean it worked like
before. Some extra info about it, I am using BeautifulSoup to get
definitions of words and well, the problem is it doesn't get links or
anything in bold or italics. So the think #6 actually was, was italics. So I
am still
Try something like this...
list = ['lkdfjsldk', None, '', '0', 'slfkjsdlfj', 'lsdgjdlfg', False, True]
for n, it in enumerate(list):
if not it: print 'Error on this definition'
else: print '%d. %s' % (n+1, it)
Results:
1. lkdfjsldk
Error on this definition
Error on this definition
4. 0
5
Alex Bryan wrote:
I am having a problem with a list value that is empty. I have a list of
definitions called mainList. the 5th value in the list doesn't have
anything in it. In this case, the values are definitions; also, in this
case just the word cheese is defined. Here is my output to the