A program asks a class and an object about themselves, through their special attributes. class Shape: pass class Square(Shape): pass sq = Square() print(type(sq).__name__, Square.__bases__[0].__name__, sq.__class__.__module__, Shape.__bases__) What does the program print?
Log in to join the discussion.
Loading…