[Tutor] Question about dictionary method get()

Francis Moore Francis.Moore at shaws.co.uk
Mon Jun 28 08:07:28 EDT 2004

From: Dick Moores [mailto:rdmoores at gmail.com] 

>In _Python in a Nutshell_, on p. 50, I find, under "Dictionary
>D.get(k[,x])    --    Returns D[k] if k is a key in D, otherwise
>returns x (or None, if x is not given)


There's a good explanation of the dictionary get() method in Recipe 1.3
the O'Reilly Python Cookbook. There's a .pdf sample chapter at the 
following URL with this recipe in which you can download:


It can probably explain it better than I can ;-)

Hope this helps,
This communication contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any distribution, copying or use of this communication or the information in it is strictly prohibited. If you have received this communication in error please notify us by e-mail or by telephone (+44(0) 1322 621100) and then delete the e-mail and any copies of it.  
This communication is from Shaw & Sons Limited whose registered office is at Shaway House, 21 Bourne Park, Bourne Road, Crayford, Kent DA1 4BZ. The views expressed in this communication may not be the views held by Shaw & Sons Limited. 
This message has been checked for all known viruses by McAfee VirusScan. 

More information about the Tutor mailing list