Nick the Gr33k writes:
> >>> name="abcd"
> >>> month="efgh"
> >>> year="ijkl"
>
> >>> print(name or month or year)
> abcd
>
> Can understand that, it takes the first string out of the 3 strings
> that has a truthy value.
>
> >>> print("k" in (name and month and year))
> True
>
> No clue. since the expression in parenthesis returns 'abcd' how can
> 'k' contained within 'abcd' ?
Why shouldn't (name or month or year) be different from (name and
month and year)?
Incidentally, you get better information without the print():
>>> 'Parker' and 'May' and '2001'
'2001'
>>>
>>> 'Parker' and 'May' and 2001
2001
>>>
Either way, the interactive prompt is your friend.
--
http://mail.python.org/mailman/listinfo/python-list