0

I am tring to print self.row with display function. However, the error says There is no no such self.row attribute when it is clearly in the class member.

Please can anyone explain to me what I am doing wrong?

thanks.

from Grid import Grid

class Matrix(Grid):
    def _init__(self, m, n, value=None):
        Grid.__init__(m, n)
        self.row = m
        self.col = n
    def display(self):
        print self.row
0

1 Answer 1

8

You are missing a '_' on your init call. It should be:

def __init__(self, m,n,value=None):
    ^
    +-- this character is missing.
Sign up to request clarification or add additional context in comments.

1 Comment

@user1047092, you can mark the answer as solved by clicking the checkmark to the left.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.