If Dict Contains a particular key

Robert Rawlins - Think Blue robert.rawlins at thinkbluemedia.co.uk
Tue Apr 24 13:28:08 EDT 2007


Hello Guys,

 

I'm Looking to build a quick if/else statement that checks a dictionary for
a key like follows.

 

If myDict contains ThisKey:

                Do this...

Else

                Do that...

 

Thats the best way of doing this?

 

Thanks,

 

Rob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070424/e5453963/attachment.html>


More information about the Python-list mailing list