Back to Freecodecamp

Step 6

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

latest631 B
Original Source

--description--

To call an instance method, you need to use dot notation:

py
instance_name.method_name()

Where instance_name is the instance or object, and method_name is the method you want to call.

Call the spam method of the gameboard object.

--hints--

You should call the spam method of the gameboard object with gameboard.spam().

js
({ test: () => assert(runPython(`_Node(_code).has_call("gameboard.spam()")`)) })

--seed--

--seed-contents--

py
--fcc-editable-region--
class Board:
    def spam(self):
        print('Spam!')
    
gameboard = Board()
--fcc-editable-region--