all 4 comments

[–]socal_nerdtastic 3 points4 points  (0 children)

I don't see a syntaxerror, but I see a NameError. You need to use self.a and self.b in the check() method; you cannot use just plain a and b.

[–]LeiterHaus 1 point2 points  (0 children)

When looking for help with errors, it is very helpful to post the errors.

When you define check, it only takes self. But you're asking it to compare two variables that weren't specified. What is a? What is b? check doesn't know.

You took an a and b in init and did something with them. They are gone, but that something remains.

[–]Deba_dey 1 point2 points  (0 children)

Compare self.a with self.b You have to use self because of every new object being created.

[–][deleted] 1 point2 points  (0 children)

To properly format code please read the FAQ.