Need help with Polygon area calculator: Argument missing

Tell us what’s happening:
Looking at other codes off of github/stackoverflow, the code’s supposed to work but apparently for some reason i am getting this error. Sorry for the rusty post.

Your code so far

class Rectangle():
  def __init__(self,width,height):
    self.width=width
    self.height=height

  def __str__(self):
    return (f" Rectangle(width={self.width}, height={self.height})")

  def set_width(self,width):
    self.width=width
    #return self.width
  
  def set_height(self,height):
    self.height=height
    #return self.height

  def get_area(self):
    return self.width*self.height

  def get_perimeter(self):
    return ( 2 * self.height + 2 * self.width )
  
  def get_diagonal (self):
    return ((self.width ** 2 + self.height ** 2) ** .5)

  def get_picture (self):
    if not (self.width>50):
      if not self.height>50:
        for i in range(self.height):
          retu= f" {'*'*self.width} \n " 
      
        return retu

      else:
        return "Too big for picture"
    else:
      return "Too big for picture"



  def get_amount_inside(self,obj):
    nos_area=obj.getarea()
    area_avai=self.getarea()
    ct=0
    while area_avai>=nos_area:  
      area_avai -= nos_area
      ct +=1
    
    return ct
  

class Square(Rectangle):
    def _init(self, side):
      super().__init__(side,side)
    
    def __str__(self):
      return (f" Square(side={self.width})")
    
    def set_side(self,lgt):
      self.height=lgt
      self.width=lgt
      #return self.side
    
    def set_width(self,lgt):
      self.set_side=lgt
    
      #return self.width, self.height

    def set_height(self,lgt):
      self.set_side=lgt
     # return self.width, self.height

Welcome, dhggaurab.

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

Thank you for the edit and the welcome. :smiley:

Hey, I’ve noticed a typo in line 42 and 43 (getarea instead of get_area) and line 46 (__init instead of “__init __”).

Also, if you use a method within a method, try coding the argument as an argument of the method (referring to set_width and set_height).

Hope this helps, I see it’s been a while :smile:

thank you for providing the closure :sweat_smile: I went on to redo the thing, but always good to know what i did wrong.