> I'm trying with this operator, could it possible?
>
> fruit1 = 'apple'
> fruit2 = 'orange'
>
> fruits = fruit1 or fruit2
>
> is 'orange' = fruits ?
Why not just try it at the python prompt?!
And you would find that no, fruits = 'apple'
(The order is because fruits is a name which references
>
> 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 'o
Hi,
I'm trying with this operator, could it possible?
fruit1 = 'apple'
fruit2 = 'orange'
fruits = fruit1 or fruit2
is 'orange' = fruits ?
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor