On Mon, Mar 14, 2016 at 8:26 PM, <jj0gen0i...@gmail.com> wrote:

> In Python is it possible to comparison-equate a variable to a List,
> Tupple, or Set and have it return True if the contents of the variable
> matches an element in the List, Tupple, or Set.
>
> E.g.
>
> x = "apple"
>
> x-list = ["apple", "banana", "peach"]
>
> If x == x-list:
>     print('Comparison is True')
> else:
>     print('Comparison is False')
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>

if x in x-list


-- 
Joel Goldstick
http://joelgoldstick.com/ <http://joelgoldstick.com/stats/birthdays>
http://cc-baseballstats.info/
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to