def main(): t1=Triangle() t1.create(3,4,5) # can call using object reference test_shape(t1) t2=Triangle() #change this Triangle.create(t2,3,4,12) # can also call using class reference test_shape(t2) c=Circle.create(7) # can be called only using class refernce test_shape(c) c2=Circle.create(-3) test_shape(c2)
def main(): t1=Triangle.create(3,4,5) use_triangle(t1) t2=Triangle.create(3,4,12) use_triangle(t2)