title: 'Rectangle' object has no attribute 'width'
body: <p>So I am just starting to use the classes portion of python and I've constructed a class and main program that my text book asked me to write.  It looks ok to me but I keep getting an error saying that my class doesn't have this specific attribute, which is weird because it should.  Now this is just a simple Rectangle, find the perimeter and area program.  So it is nothing too complicated.  But maybe you guys can see something I cannot.</p>
  
  <p>Here is what my class looks like:</p>
  
  <pre><code>class Rectangle:
      def __init__(self, length = 1, width = 1):
          self.length = length
          self.width = width
  
      def setWidth(self, width):
          self.width = width
  
      def setLength(self, length):
          self.length = length
  
      def getPerimeter(self):
          return (2 * self.length) + (2 * self.width)
  
      def getArea(self):
          return self.length * self.width
  </code></pre>
  
  <hr>
  
  <p>Here is the actual main program</p>
  
  <pre><code>from Rectangle import Rectangle
  
  recWidth = eval(input("Enter the length of the rectangle: "))
  recLength = eval(input("Enter the width of the rectangle: "))
  x = Rectangle()
  y = Rectangle()
  x.width(recWidth)
  x.length(recLength)
  print("The perimeter of a rectangle with a width of", recWidth,
        " units and a length of ", recLength, " units is ", x.getPerimeter(), ".")
  </code></pre>
  
  <p>Thanks I hope I have provided enough information to help formulate a valid question.</p>