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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4