1.
m = {'a': 1, 'b': 2}
m[ 'c' ] will throw error. Instead use m.get( 'c', 'default' )
2.
'foo'.index( 'bar' ) throws Exception
'foo'.find( 'bar' ) returns -1
m = {'a': 1, 'b': 2}
m[ 'c' ] will throw error. Instead use m.get( 'c', 'default' )
2.
'foo'.index( 'bar' ) throws Exception
'foo'.find( 'bar' ) returns -1
No comments:
Post a Comment