I have re-done it a few times but I can't get it to work... It detects collisions when button1 is in the lower and/or right-most part of button2, but not if it's in the upper and/or left-most part... Would be nice to know what the problem is cuz I suck at debugging...

```
if (
    (
        (button1.Top >= button2.Top && button1.Top <= (button2.Top + button2.Height)) 
        || (button1.Bottom >= button2.Bottom && button1.Bottom <= (button2.Bottom + button2.Height))
    ) 
    && 
    (
        (button1.Left >= button2.Left && button1.Left <= (button2.Left + button2.Width)) 
        || (button1.Right >= button2.Right && button1.Right <= (button2.Right + button2.Width))
    )
)

```
['https://Stackoverflow.com/questions/34365395', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5696900/']
In general, I think that question is more suited for Code Review not Stack Overflow.

Maybe you should rethink your class completely. For me it looks a lot like you wanted to model the student and not the classroom. Something like following might fit your needs better: 

```
class Student(object):
    """A class to model students"""

    def __init__(self, age, grade, name):
        self.age = age
        self.grade = grade
        self.name = name

    def get_all_information(self):
        """Get all information about the student"""
        return (self.age, self.grade, self.name)

james = Student(15, 9, 'James Herbert')
print(james.get_all_information())

```

**Edit:**
It seems others like [Prune](https://stackoverflow.com/users/4785185/prune) came up with the same idea.
The central problem is that james\_all is a local variable of the method **Classroom.James**. It is not an attribute of the class. Unless you're within the **James** method, it has no useful value.

In **print\_student**, you made it a parameter, but when you called **print\_student** from the main program, you didn't supply the argument.

Perhaps you're looking for a general property of a student in the classroom?
Have a method to initialize an object of the class and pass the defining values to that when you create a new instance.

```
class Student(object):
    def __init__(self, name, age, grade):
        self.name = name
        self.age = age
        self.grade = grade

    def print_student(self):
        print (self.age, self.grade, self.name)

James = Student('James Herbert', 15, 9)
James.print_student()

```

Output:

```
15, 9, 'James Herbert'

```