Lad kirjoitti:
> 
> Thank you for ALL for help.
> Hendrik,
> your solution works great but
> what is `_`  in
> _.replace(',',', ')
> 
> for?
When you are trying things out in the Python shell IDLE, _ is a 
shorthand way to use the last value printed by IDLE.

Thus when
        s.replace(', ',',')
prints out
        'hello,goodbye,boo'
_ refers to that value so the replace operation
        _.replace(',',', ')

manipulates that value.

Cheers
Jussi
> Thank you
> La.
> 
>> re's are a pain.  Do this instead:
>>
>>>>> s = "hello, goodbye,boo"
>>>>> s.replace(', ',',')
>> 'hello,goodbye,boo'
>>>>> _.replace(',',', ')
>> 'hello, goodbye, boo'
>> Hope this helps - Hendrik
> 
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to