python type checking and type conversion

  1. Type checking

     () type (integer, floating point, boolean, string, void) of the type used to check the value of
     the result of the check function will return as a return value, the return value of the function can be received by the variable

    Print (type (. 1))          # <class 'int'> 
    Print (type (for 1.5))        # <class 'a float'> 
    Print (type (True))       # <class 'BOOL'> 
    Print (type ( ' Hello ' ) )    # <class 'STR'> 
    Print (type (None))       # <class 'NoneType'> 
    
    A = type (123 )
     Print ( ' 123 numeric type test results return values: ' , A)
     # 123 numeric type checking result is returned value: <class 'int'>

     

  2. Type Conversion

Guess you like

Origin www.cnblogs.com/FlyingLiao/p/11142225.html