simple problem with lists I am just forgetting
- From: Alexnb <alexnbryan@xxxxxxxxx>
- Date: Thu, 31 Jul 2008 12:51:49 -0700 (PDT)
Lets say we have this list:
funlist = ['a', 'b', 'c']
and lets say I do this:
if funlist[4]:
print funlist[4]
I will get the exception "list index out of range"
How can I test if the list item is empty without getting that exception?
--
View this message in context: http://www.nabble.com/simple-problem-with-lists-I-am-just-forgetting-tp18762181p18762181.html
Sent from the Python - python-list mailing list archive at Nabble.com.
.
- Follow-Ups:
- Re: simple problem with lists I am just forgetting
- From: bearophileHUGS
- Re: simple problem with lists I am just forgetting
- Prev by Date: Re: Boolean tests [was Re: Attack a sacred Python Cow]
- Next by Date: Re: simple problem with lists I am just forgetting
- Previous by thread: Hobbyist - Python vs. other languages
- Next by thread: Re: simple problem with lists I am just forgetting
- Index(es):
Relevant Pages
|