in [ ] string formattingto be visited later in [ ]print ' is %sb is % (type( )type( ) is is in [ ] out[ ] knowing the type of an object is importantand it' useful to be able to write functions that can handle many different kinds of input you can check that an object is an instance of particular type using the isinstance functionin [ ] in [ ]isinstance(aintout[ ]true isinstance can accept tuple of types if you want to check that an object' type is among those present in the tuplein [ ] in [ ]isinstance( (intfloat)out[ ]true in [ ]isinstance( (intfloat)out[ ]true attributes and methods objects in python typically have both attributesother python objects stored "insidethe objectand methodsfunctions associated with an object which can have access to the object' internal data both of them are accessed via the syntax obj attribute_namein [ ] 'fooin [ ] capitalize format center index count isalnum decode isalpha encode isdigit endswith islower expandtabs isspace find istitle isupper join ljust lower lstrip partition replace rfind rindex rjust rpartition rsplit rstrip split splitlines startswith strip swapcase title translate upper zfill attributes and methods can also be accessed by name using the getattr functiongetattr( 'split'while we will not extensively use the functions getattr and related functions hasattr and setattr in this bookthey can be used very effectively to write genericreusable code the basics www it-ebooks info