Pierre Barbier de Reuille wrote: >> >>I would actualy use the following for this particular case.. >> >>text = line[n:n+1] or 'nothing' > > > ... and you would get either a list of one element or a string ... > I think you wanted to write : > > text = (line[n:n+1] or ['nothing'])[0]
I was assuming that 'line' would be a string, not a list. Seems more likely give the name and context. Will McGugan -- http://www.kelpiesoft.com -- http://mail.python.org/mailman/listinfo/python-list