Back to Freecodecamp

Step 3

curriculum/challenges/english/blocks/learn-classes-and-objects-by-building-a-sudoku-solver/6606927d010be4300a4e5330.md

latest649 B
Original Source

--description--

The instantiation creates an empty object. But classes can have methods, which are like local functions for each instance. Within a class, methods are declared as follows:

py
class ClassName:
    def method_name():
        pass

Inside the Board class, replace pass with an empty method spam.

--hints--

You should define a method named spam inside the Board class.

js
({ test: () => assert(runPython(`_Node(_code).find_class("Board").has_function("spam")`)) })

--seed--

--seed-contents--

py
--fcc-editable-region--
class Board:
    pass
    
gameboard = Board()
--fcc-editable-region--