On 2013-06-14, Nick the Gr33k <supp...@superhost.gr> wrote: > I started another thread
no kidding. > because the last one was !@#$'ed up by irrelevant replies and was > difficult to jeep track. > > >>> 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. Yes, it does. That's the way the language is defined to work. If you don't like it, pick a different language. > >>> print("k" in (name and month and year)) > True > > No clue. since the expression in parenthesis returns 'abcd' No it doesn't. Try it: Python 2.7.3 (default, Mar 20 2013, 14:16:24) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> name="abcd" >>> month="efgh" >>> year="ijkl" >>> >>> "k" in (name and month and year) True >>> (name and month and year) 'ijkl' >>> > how can 'k' contained within 'abcd' ? It doesn't -- Grant Edwards grant.b.edwards Yow! Am I having fun yet? at gmail.com -- http://mail.python.org/mailman/listinfo/python-list