Menu
CoddyTech

Output

Part of the Fundamentals section of Coddy's GDScript journey. Lesson 31 of 92.

A program shows its results as output. Writing output is often called printing. In GDScript, print() writes one line of text to the output:

print("Hello")

The text goes inside quotation marks. Double quotes and single quotes both work, so these two lines print the same thing:

print("Game Over")
print('Game Over')

Every print() ends its line, so the next print() starts on a new one. A print() with nothing inside prints an empty line:

print("Level 1")
print()
print("Level 2")

This prints Level 1, an empty line, then Level 2.

Text without quotation marks is read as code: print(Hello) looks for a variable named Hello, and GDScript reports an error because there is none.

challenge icon

Challenge

Beginner

Write a program that prints these two lines:

I love GDScript
Let's make games!

Use one print() for each line, and replace the line pass with your code.

Try it yourself

extends Node

func _ready():
	# Print the two lines here
	pass
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals

Practice on your own: Online GDScript compiler