Question: If I have a dictionary defined as `users = {}`, and lets say I have some data in that dictionary, how could I search through the dictionary, and do nothing if my search string matches a string in my dictionary.

```
for socket.user in MyServer.users:
    if ((MyServer.users.has_key(socket.user)) == false):
        MyServer.users[user].send(socket.message)

```

So here is searches the users dictionary, and finds that it is present, so it should do nothing. I know my code is wrong, but what could I change on the second line?

Answer: 
> 
> How could I search through the dictionary, and do nothing if my search string matches a string in my dictionary.
> 
> 
> 

```
if socket.user in MyServer.users: # search if key is in dictionary
   pass # do nothing

```
Am I missing something, or is this what you are looking for:

```
if socket.user in MyServer.users:
    # Send a message if it's a valid user
    MyServer.users[user].send(socket.message)
else:
    # Do nothing if it isn't
    pass

```