0
class Grid:
    def __init__(self, cellNum, cellData):
        self.cellNum, self.cellData = cellNum, cellData

I am new to python and wondering if there is any more clearer way to write this? I am trying to solve a nonogram and therefore needs to understand this part.

1 Answer 1

4

You can break up the initialisation line, but I think the code can't get clearer than that:

class Grid:
    def __init__(self, cellNum, cellData):
        self.cellNum = cellNum
        self.cellData = cellData
Sign up to request clarification or add additional context in comments.

2 Comments

Oh, that easy. Thank you. I feel dumb now. It was just so confusing the way it was written.
@BjornarRemmen Don't feel dumb. You've learned something. In fact, you should feel smarter.

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.