['a', 'b'][True] results 'b' But how?
nitte.sudhir at gmail.com
Thu Jul 5 08:54:41 CEST 2007
Can any one please tell me how is the following code is working?
['a','b'] is a list of string, and [True] is list of boolean value.
How is it making effect....?
>>> ['a','b] [True]
>>> ['a','b'] [False]
>>> ['a','b']['some_string' == r'some_string']
>>> ['a','b']['some_string' == r'somestring']
Thanks in advance,
More information about the Python-list