Question: I want to check if an input value is equal a value inside the list without going through every value inside the list.

```
list=('a','b','c','d')
test=raw_input('enter letter')
if test in list:
   if test == a:
         (code)
   if test == b:
         (code)
   if test == c:
         (code)
   if test == d:
         (code)

```

Answer: 
This is really a tuple not a list. But yes, you can use the `in` membership test for this.

With a `tuple`:

```
In [1]: mtuple=('a','b','c','d')

In [2]: 'a' in mtuple
Out[2]: True

In [3]: 'z' in mtuple
Out[3]: False

```

Works the same with a `list` too:

```
In [4]: mlist=['a','b','c','d']

In [5]: 'a' in mlist
Out[5]: True

In [6]: 'z' in mlist
Out[6]: False

```

More on the membership test with [in](http://docs.python.org/reference/expressions.html#in) toward the bottom of the page:

> 
> The operators in and not in test for collection membership. x in s
>  evaluates to true if x is a member of the collection s, and false
>  otherwise. x not in s returns the negation of x in s. The collection
>  membership test has traditionally been bound to sequences; an object
>  is a member of a collection if the collection is a sequence and
>  contains an element equal to that object. However, it make sense for
>  many other object types to support membership tests without being a
>  sequence. In particular, dictionaries (for keys) and sets support
>  membership testing.
> 
> 
>
While you can do things with dictionaries to emulate a switch statement, for only a few items (4 in this case), there's nothing wrong with using `if` statements

You could use the `elif` statement (short for "else if"), to make it clear only one of the branches will be executed (e.g if it matches "a", there's no point checking c, and d).

Also the initial `if test in mylist:` check seemed redundant in your example code

So it can be simplified to:

```
things=('a','b','c','d')
test=raw_input('enter letter')

if test == "a":
    code("was called with 'a'!")
elif test == "b":
    code("was called with 'b'!")
elif test == "c":
    code("was called with 'c'!")
elif test == "d":
    code("was called with 'd'!")
else:
    # Optional else block, executed if the input wasn't a, b, c or d
    print "Uhoh"

```