1class SillyClassName:
2 @classmethod
3 def my_name(cls_):
4 return cls_.__name__
5
6 def class_name(self):
7 # self.__class__ gets the current class
8 # .__name__ gets the name
9 return self.__class__.__name__
10
11SillyClassName.my_name()
12# prints SillyClassName
13
14inst = SillyClassName()
15inst.class_name()
16# prints SillyClassName