On 06/05/2011 14:17, scattered wrote:
On May 6, 8:25 am, Christian Heimes wrote:
Am 06.05.2011 14:09, schrieb scattered:
sets could also work
if set('abc')& set(line) == set():
print line
Right!
Sets work in this special case, because the OP just wants to search for
a single char.
On May 6, 8:25 am, Christian Heimes wrote:
> Am 06.05.2011 14:09, schrieb scattered:
>
> > sets could also work
>
> > if set('abc') & set(line) == set():
> > print line
>
> Right!
> Sets work in this special case, because the OP just wants to search for
> a single char. It won't work for long
Am 06.05.2011 14:09, schrieb scattered:
> sets could also work
>
> if set('abc') & set(line) == set():
> print line
Right!
Sets work in this special case, because the OP just wants to search for
a single char. It won't work for longer strings, though.
Also I would write the test as:
if set
On May 6, 7:00 am, Christian Heimes wrote:
> Am 06.05.2011 12:47, schrieb Lutfi Oduncuoglu:
>
> > Hi,
>
> > I am trying to write a script and I realised that I need to use something
> > like
>
> > if ('a' or 'b' or 'c') not in line:
> > print line
>
> > But it does not work for. What may be th
On Fri, May 6, 2011 at 8:47 PM, Lutfi Oduncuoglu
wrote:
> I am trying to write a script and I realised that I need to use something
> like
>
> if ('a' or 'b' or 'c') not in line:
> print line
>
> But it does not work for. What may be the problem
You will need to (naively) do this:
if "a" not
On Fri, May 6, 2011 at 4:02 AM, Albert Hopkins wrote:
> On Fri, 2011-05-06 at 13:47 +0300, Lutfi Oduncuoglu wrote:
>> Hi,
>>
>> I am trying to write a script and I realised that I need to use
>> something like
>>
>> if ('a' or 'b' or 'c') not in line:
>> print line
>>
>
> The expression:
>
Correction:
('a' or 'b' or 'c') evaluates to 'a'
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 2011-05-06 at 13:47 +0300, Lutfi Oduncuoglu wrote:
> Hi,
>
> I am trying to write a script and I realised that I need to use
> something like
>
> if ('a' or 'b' or 'c') not in line:
>print line
>
The expression:
('a' or 'b' or 'c')
evaluates to True
True not in line
Is
Am 06.05.2011 12:47, schrieb Lutfi Oduncuoglu:
> Hi,
>
> I am trying to write a script and I realised that I need to use something
> like
>
> if ('a' or 'b' or 'c') not in line:
>print line
>
> But it does not work for. What may be the problem
if any(s not in line for s in ('a', 'b', 'c'))
Hi,
I am trying to write a script and I realised that I need to use something
like
if ('a' or 'b' or 'c') not in line:
print line
But it does not work for. What may be the problem
Thanks,
Lutfi
--
http://mail.python.org/mailman/listinfo/python-list
10 matches
Mail list logo