How to write simple code to match strings?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Wed Dec 30 07:20:10 EST 2009


On Tue, 29 Dec 2009 23:07:15 -0800, beginner wrote:

>> def convert_data_item(s):
>>     if s = '-':
[...]
> I don't know if it should be s=='-' or s='-'. I thought == means equal
> and = means assignment?

Er, you're absolutely right.

Sorry for that, that's an embarrassing brain-fart. I don't know what I 
was thinking.


-- 
Steven



More information about the Python-list mailing list