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

```
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"

```