If Dict Contains a particular key

Carsten Haese carsten at uniqsys.com
Tue Apr 24 19:44:42 CEST 2007


On Tue, 2007-04-24 at 18:28 +0100, Robert Rawlins - Think Blue wrote:
> 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...

I'm pretty sure you'll find the answer to this question somewhere in
http://docs.python.org/tut/tut.html

-Carsten





More information about the Python-list mailing list