“Shashwat's Class Extension turtle"

by shashwatj14

10 Nov 2022

I created a class with a custom function - Overridden the Dunder function and chnaged the tutle parameters. (shape and color)

Created a function to draw the shape required:

  def draw(self, shape, size):
    if(shape == "circle"):
      self.circle(size)
    elif(shape == "square"):
      self.square(size)
    elif(shape == "triangle"):
      self.triangle(size)

Here’s my trinket:

Here's a little about shashwatj14 Find shashwatj14 on Twitter, Github, and on the web.