It throws you this error because in effect your Rectangle object does not have any 'corner' attribute, this is because your class is not implemented correctly.
The correct way to implement your rectangle class would be the following:
def __init__(self, an, al, x, y):
self.an = an
self.al = al
self.x = x
self.y = y
return(((self.x + self.an)/2), ((self.y + self.al)/2))
rect = Rectangulo(200.0, 100.0, 4.0, 5.0)
When you create a class the first thing you have to do is pass " object " as an argument (In doing this you are creating a sub-class of object, all classes are "sub- classes "of object but I will not go into this topic because it is not relevant and you can google it) .
The next thing is to use the method
__init__(self): , this method is the first thing that is executed when instantiating a class and this is where the arguments that must be passed to the class are placed so that this can be instantiated.
The first parameter should always be " self " (it can be the word you want but self is the one commonly used) , followed by the arguments you choose .
To be able to access these arguments from within the class, you have to define them as follows
self.argumento = argumento (these new variables are commonly named as the argument you are assigning to them, but you can name them as you like)
Since you defined your variables in __ init __ you can define the methods of your class the methods are defined as any function but you always have to pass them the self argument and if you spend more of a self argument should always be the first.
That's the correct way to implement a class.
To instantiate a class and use it you have to assign it to a variable
rect = Rectangulo(200.0, 100.0, 4.0, 5.0) , when a class is instantiated you do not have to pass the argument self only those that you have defined.
The methods of the classes are used with the "point notation"
clase.metodo() where class is the instance of a class
This explanation is extremely basic and does not cover more than the surface of the subject of the classes and the object-oriented programming.
I recommend this course , it's in English but you can Subtitle videos and it's free.