How to print variable value?

Godot Version

4.2.1

Question

Might seem a little bit of a silly question, but how do you print variables to the console?


This does not work.
Error at (11, 1): Unexpected “Identifier” in class body.

I am new to gdscript and it appears to have quite a few limitations and quirks so I do need some help.

You have to put print() inside a function