python issubclass

Solutions on MaxInterview for python issubclass by the best coders in the world

showing results for - "python issubclass"
Salvatore
03 Aug 2017
1class Polygon:
2  def __init__(polygonType):
3    print('Polygon is a ', polygonType)
4
5class Triangle(Polygon):
6  def __init__(self):
7
8    Polygon.__init__('triangle')
9    
10print(issubclass(Triangle, Polygon)) # true
11print(issubclass(Triangle, list)) #false 
12print(issubclass(Triangle, (list, Polygon))) #true
13print(issubclass(Polygon, (list, Polygon))) #true