Menu
Coddy logo textTech

Printing Output

Part of the Fundamentals section of Coddy's Dart journey — lesson 3 of 94.

Dart's print() function displays information to the console, useful for output and debugging.

void main() {
  print('Hello, Dart!');
}

This displays Hello, Dart! in the console. Multiple print statements output on separate lines:

void main() {
  print('First line');
  print('Second line');
  print('Third line');
}

Result:

First line
Second line
Third line
challenge icon

Challenge

Beginner

Use the code view to write a program that outputs Hello World!

Note that anything inside quotation marks is case sensitive. For example:

print('Hello World!');
print("hello world!");

are different things (notice the capital letters in the first line).

Cheat sheet

Dart's print() function displays information to the console:

void main() {
  print('Hello, Dart!');
}

Multiple print statements output on separate lines:

void main() {
  print('First line');
  print('Second line');
  print('Third line');
}

Text inside quotation marks is case sensitive.

Try it yourself

void main() {
    // Print 'Hello World!'
}
quiz iconTest yourself

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

All lessons in Fundamentals