On 8/24/07, Chris Calloway <[EMAIL PROTECTED]> wrote
Thanks everybody for their assistance! Makes my code a lot more elegant.
-Tino
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Alan Gauld wrote:
> "Chris Calloway" <[EMAIL PROTECTED]> wrote
>
> dbs = set(['oracle','mysql','postgres','infomix','access'])
> mine = set(['oracle','mysql','bdb'])
> dbs & mine
>> set(['oracle', 'mysql'])
> dbs - mine
>> set(['access', 'infomix', 'postgres'])
>
> Interesting. I
"Chris Calloway" <[EMAIL PROTECTED]> wrote
> >>> dbs = set(['oracle','mysql','postgres','infomix','access'])
> >>> mine = set(['oracle','mysql','bdb'])
> >>> dbs & mine
> set(['oracle', 'mysql'])
> >>> dbs - mine
> set(['access', 'infomix', 'postgres'])
Interesting. I didn't know about the & an
"Tino Dai" <[EMAIL PROTECTED]> wrote
> dbs= ['oracle','mysql','postgres','infomix','access']
>
> and we wanted to do this:
>
> if 'oracle' in dbs or 'mysql' in dbs or 'bdb' in dbs:
> <... do something ...>
>
> Is there a short way or writing this? Something like
>('oracle','mysql','bdb'
Tino Dai wrote:
> I am wondering about a short cut to doing this. Let's say that we
> have an array:
>
> dbs= ['oracle','mysql','postgres','infomix','access']
>
> and we wanted to do this:
>
> if 'oracle' in dbs or 'mysql' in dbs or 'bdb' in dbs:
><... do something ...>
>
> Is there a
Tino Dai wrote:
> Hi there,
>
> I am wondering about a short cut to doing this. Let's say that we
> have an array:
>
> dbs= ['oracle','mysql','postgres','infomix','access']
>
> and we wanted to do this:
>
> if 'oracle' in dbs or 'mysql' in dbs or 'bdb' in dbs:
><... do something ...>
>
Hi there,
I am wondering about a short cut to doing this. Let's say that we have
an array:
dbs= ['oracle','mysql','postgres','infomix','access']
and we wanted to do this:
if 'oracle' in dbs or 'mysql' in dbs or 'bdb' in dbs:
<... do something ...>
Is there a short way or writing this? S