how to write your first line of code

Write Your First Line of Code; No Setup, No Stress

You don’t need to install anything. You don’t need to be a tech wizard.
All you need is curiosity and a browser. In this post, we’ll write your very first line of code together using Python, one of the most beginner-friendly languages out there.

What You’ll Do

We’ll use an online Python editor so you can run code instantly. No downloads. No configuration. Just type and go.

Here’s your first line of code:

print("Hello, world!")

This tells the computer to display a message. Try it out at programiz.com/python-programming/online-compiler.

What Just Happened?

  • print() is a function — it tells Python to do something.
  • "Hello, world!" is a string — a piece of text.
  • The result? Your computer talks back. That’s the magic of code.

Try This Next

Change the message to anything you want:

print("I’m learning to code!")

Or even:

print("Coding is fun 🎉")

You’re now officially a programmer.

how to write your first line of code

What’s Next?

In the next post, we’ll explore variables; how to store information and reuse it. You’ll learn how computers “remember” things and how you can control that memory.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top