Can anybody explain the '-' in a 2-D creation code?

Mark Lawrence breamoreboy at yahoo.co.uk
Thu Jun 25 22:27:45 EDT 2015


On 26/06/2015 02:40, fl wrote:
> On Thursday, June 25, 2015 at 6:24:07 PM UTC-7, Mark Lawrence wrote:
>> On 26/06/2015 02:07, fl wrote:
>>> Hi,
>>>
>>> I read Ned's tutorial on Python. It is very interesting. On its last
>>> example, I cannot understand the '_' in:
>>>
>>>
>>>
>>> board=[[0]*8 for _ in range(8)]
>>>
>>>
>>> I know  '_' is the precious answer, but it is still unclear what it is
>>> in the above line. Can you explain it to me?
>>>
>>>
>>> Thanks,
>>>
>>
>> Lots of people could carry on explaining things to you, but you don't
>> appear to be making any attempt to do some research before posing your
>> questions, so how about using a search engine?
>>
>> --
>> My fellow Pythonistas, ask not what our language can do for you, ask
>> what you can do for our language.
>>
>> Mark Lawrence
>
> Excuse me. On one hand, I am busying on cram these Python stuff quickly for
> a position. On the other hand, the search seems to me needing a little
> skill to get the goal I hope. I would really appreciate if someone can give
> an example on what phrase to use in the search. I am not a lazy guy.
> Thanks to all the response.
>

http://stackoverflow.com/questions/5893163/what-is-the-purpose-of-the-single-underscore-variable-in-python

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list