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()

```
Were you thinking of something like this perhaps?

```
def block_a():
    print "AAA"

def block_b():
    print "BBB"

def block_c():
    print "CCC"

d = {"A": block_a, "B" : block_b, "C" : block_c}

test=raw_input('enter letter: ')

d[test]()

```