Skip to main content
Programming from zero

First steps theory + first problem: print a service status message

easyFirst steps Must-do

Problem statement

A program is a list of instructions the computer follows from top to bottom.

  • Writing code only creates those instructions.
  • Running it is what actually executes them, one by one.
flowchart LR A[Write the code] --> B[Run it] B --> C[Computer follows each line] C --> D[Program output appears on screen] classDef write fill:#DBEAFE,stroke:#2563EB,color:#1E3A8A classDef run fill:#FEF3C7,stroke:#D97706,color:#92400E classDef follow fill:#E0E7FF,stroke:#4F46E5,color:#312E81 classDef output fill:#D1FAE5,stroke:#059669,color:#065F46 class A write class B run class C follow class D output

The first thing every programmer learns is print, showing text on the screen. Whatever a program prints is called its output. You'll use it throughout this track to check what your programs are doing.

Common mistake: forgetting the quotation marks around the text.

  • Wrong: print(Service is healthy)
  • Right: print("Service is healthy")

Without the quotes, the computer thinks Service, is, and healthy are things you've already defined somewhere, not plain text, and it will refuse to run.

Your task: write a program that prints exactly this line: Service is healthy

Expected output:

TEXT
Service is healthy

Approach

Each language does the same thing here, printing text to the screen, just with different syntax:

  • Python calls the print(...) function.
  • Java calls the System.out.println(...) method.
  • C++ pushes the text into std::cout using the << operator, then std::endl to move to a new line after it.

Java and C++ also need a bit of setup Python doesn't:

  • Java wraps the line inside a class, with a main method as the program's starting point.
  • C++ needs #include <iostream> at the top to unlock printing, plus its own main function. The return 0; at the end just tells the computer the program finished with no errors - you'll see that line at the end of most C++ programs.

None of that setup changes what actually happens. Run any of the three, and the only thing that shows up is Service is healthy.

print("Service is healthy")