get name of class python from within code example Example 1: python get type class name type(x).__name__ Example 2: python class name instance.__class__.__name__