Python Program to Get the Class Name of an Instance (Using __class__.__name__)

bookmark

class Vehicle:
    def name(self, name):
        return name

v = Vehicle()
print(v.__class__.__name__)

 

Output

Vehicle