Menu
Coddy logo textTech

Hello World!

Part of the Fundamentals section of Coddy's Solidity journey. Lesson 2 of 53.

A "Hello World!" program displays a short greeting. In these Solidity exercises, use console.log to print text in the output area.

Put the text inside quotation marks, enclose it in parentheses and end the statement with a semicolon:

console.log("Hello, builder!");

Write this statement inside the main function already provided in the code editor. Keep the surrounding code for now; the Basic Program Structure lesson explains it.

Text is case-sensitive: "Hello" and "hello" print different messages. The quotation marks themselves are not printed.

challenge icon

Challenge

Easy

Use the code editor to print Hello World!. Fill in the empty quoted text inside the supplied console.log call. Keep the capital letters, space and exclamation mark exactly as shown.

Use console.log for the requested output. Print only the requested values, one per line, with no extra labels unless the task specifies them.

Try it yourself

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
import "forge-std/console.sol";
contract Main {
    function main() external view {
        console.log("");
    }
}
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: Solidity playground