Menu
Coddy logo textTech

Println

Part of the Fundamentals section of Coddy's GO journey — lesson 3 of 109.

Println is a function from the fmt package that prints text followed by a line break. You can print multiple items with a single call.

Print a simple message:

fmt.Println("Learning Go is fun!")

When you run this code, you'll see:

Learning Go is fun!

Print multiple values separated by commas:

fmt.Println("Go", "is", "awesome")

The output shows all items with spaces between them:

Go is awesome
challenge icon

Challenge

Beginner

In this challenge, you'll practice using fmt.Println() to display multiple values on the same line.

Your task is to use fmt.Println() to print the text Alex 25 coding on a single line.

Remember that fmt.Println() can accept multiple arguments, and it will automatically add spaces between them.

Cheat sheet

Use fmt.Println() to print text followed by a line break:

fmt.Println("Learning Go is fun!")

Print multiple values separated by commas (spaces are automatically added between them):

fmt.Println("Go", "is", "awesome")

Try it yourself

package main

import "fmt"

func main() {
	// TODO: Use fmt.Println() to print "Alex 25 coding" on a single line
	// Hint: You can provide multiple arguments to fmt.Println()
	fmt.Println(?, ?, ?)
}
quiz iconTest yourself

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

All lessons in Fundamentals