Source Code:
(back to article)
class MyClass: pass obj = MyClass() def classname(obj): return obj.__class__.__name__ class_name = classname(obj) print(class_name) # Output: "MyClass"
Result:
Report an issue