[Tutor] OR operator?

Charles Bartley blackspeckpotato at frontiernet.net
Thu Apr 6 07:50:30 CEST 2006


>
> I'm trying with this operator, could it possible?
>
> fruit1 = 'apple'
> fruit2 = 'orange'
>
> fruits = fruit1 or fruit2
>
> is 'orange' = fruits ?

Maybe this:

#######

fruit1 = 'apple'
fruit2 = 'orange'

fruits = [fruit1, fruit2]

print 'orange' in fruits    # prints the boolean result of 'orange in 
fruits'

#######

Regards,
Charles B. 



More information about the Tutor mailing list