Skip to content

Instantly share code, notes, and snippets.

@calthoff
Created March 26, 2018 23:22
Show Gist options
  • Select an option

  • Save calthoff/3d04ec8427e202c6430975956b4a4f19 to your computer and use it in GitHub Desktop.

Select an option

Save calthoff/3d04ec8427e202c6430975956b4a4f19 to your computer and use it in GitHub Desktop.
shapes = [tr1, sq1, cr1]
for a_shape in shapes:
if type(a_shape) == "Triangle":
a_shape.draw_triangle()
if type(a_shape) == "Square":
a_shape.draw_square()
if type(a_shape) == "Circle":
a_shape.draw_circle()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment