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 better done with a dictionary.

```
def a_code():
    print "a"
def b_code():
    print "b"

d={'a':a_code,'b':b_code}
test=raw_input("enter a or b")
d[test]()

```

Of course, if code is the same in each case, you could do:

```
if test in ('a', 'b', 'c', 'd'): #tuple
   do_something()

```

which is functionally equivalent to:

```
if test in ['a', 'b', 'c', 'd']: #list slower than tuple -- ('a', 'b', 'c', 'd')
   do_something()

```

or, more simply:

```
if test in 'abcd': # string
   do_something()

```
You can easily find the index of the matching item using the `index` method of sequences:

```
choices=('a','b','c','d')
test=raw_input('enter letter: ')
if test in choices:
    index = choices.index(test)
    # do something based on index

```

(I changed the name of the variable named `list` in your sample code to `choices` because `list` is the predefined name of a fundamental type in Python -- besides that, the variable actually contains a tuple of values, not a list of them because they're enclosed in parentheses instead of square brackets.)

The `if test in choices:` tells you quickly if the value assigned to `test` is equal to any of those in `choices`. The `index()` method does essentially the same thing but also tells you the index of which one. One important difference between them is that when the value isn't in the sequence, the `index()` method will throw a `ValueError`, whereas the `in` operator will just return `False` if there's no match.

Since they're so similar, it's uncommon (as well as inefficient) to use them both as shown.

From the rest of your code it looks like perhaps what you *really* wanted to know is a good way of dispatching based on the value of `test`. As many of the other answers indicate, this is often done with a dictionary in Python since it has no `switch` or `case:` statement found in other programming languages.

To add to the other examples, here's a somewhat novel way to build and use one (a dictionary) on-the-fly:

```
def func_a(): pass
def func_b(): pass
def func_c(): pass
def func_d(): pass

test = raw_input('enter letter: ')
try:
    {'a': func_a,
     'b': func_b,
     'c': func_c,
     'd': func_d,
    }[test]()  # call corresponding function
except KeyError:
    # handle other values of test
    ...

```

Another alternative, since the names of the `func_x`'s defined are all global variables, which allows you to avoid even having to build your own dictionary, would be to just use the one returned by the built-in `globals()` function instead:

```
test = raw_input('enter letter: ')
try:
    globals()['func_'+test]()  # call appropriately named function
except KeyError:
    # handle illegal values of test
    ...

```