Skip to main content
pep8 format x)
Source Link
Evhz
  • 9.4k
  • 9
  • 55
  • 71

You should use the get() method from the dict class

d = {} r = d.get( 'missing_key', None ) 

This will result in r == None. If the key isn't found in the dictionary, the get function returns the second argument.

You should use the get() method from the dict class

d = {} r = d.get( 'missing_key', None ) 

This will result in r == None. If the key isn't found in the dictionary, the get function returns the second argument.

You should use the get() method from the dict class

d = {} r = d.get('missing_key', None) 

This will result in r == None. If the key isn't found in the dictionary, the get function returns the second argument.

You should use the get()get() method from the dictdict class

d = {} r = d.get( 'missing_key', None ) 

This will result in r == Noner == None. If the key isn't found in the dictionary, the get function returns the second argument.

You should use the get() method from the dict class

d = {} r = d.get( 'missing_key', None ) 

This will result in r == None. If the key isn't found in the dictionary, the get function returns the second argument.

You should use the get() method from the dict class

d = {} r = d.get( 'missing_key', None ) 

This will result in r == None. If the key isn't found in the dictionary, the get function returns the second argument.

Source Link
dusktreader
  • 4.1k
  • 8
  • 34
  • 40

You should use the get() method from the dict class

d = {} r = d.get( 'missing_key', None ) 

This will result in r == None. If the key isn't found in the dictionary, the get function returns the second argument.