37.5 C
Sydney
Saturday, December 6, 2025

Python for Beginners #2: Your First “Hello, World!” with Trinket

In our last post, we learned what Python is and all the awesome things it can do. We talked about it being a “secret language” for talking to computers. Now, it’s time to stop talking about code and start writing it!

Every coder, from the person who created Instagram to the developers who build your favourite games, starts their journey in the exact same way: by making the computer say “Hello, World!”. It’s a fun tradition and the perfect first step. This simple program proves that you have everything set up correctly and that you can give the computer a command and make it listen.

For our lessons, we’ll use a fantastic free tool called Trinket, which lets you write and run Python code right in your web browser. No installation needed!

What You’ll Learn Today

  • How to use the basic Trinket online editor.
  • What the print() function is and how to use it.
  • What a “string” is in programming.
  • How to run your very first Python program!

Step-by-Step: Let’s Write Some Code!

Ready to become a coder? Follow these simple steps.

Step 1: Your Coding Playground is Right Here!

Below this paragraph, you’ll see an interactive Trinket window embedded right on this page. This is your coding playground!

You can write and run your code without ever leaving this article. The window is split into two halves:

  • The left side is your editor. This is where you will write your Python code.
  • The right side is the console. This is where the output of your code will appear.

Go ahead and try the code from the next steps directly in the window below!

Step 2: Meet Your First Command: The print() Function

The first command you’ll learn is print(). It’s a special keyword in Python called a function, and its job is to display whatever you put inside its parentheses on the screen. It’s like the “Say” block in Scratch, but for text-based coding.

Step 3: Write the Code

Now for the fun part! In the editor on the left side of your Trinket window, carefully type the following line of code:

print("Hello World from Innovation Camp Australia!")

Let’s quickly break down that single line:

  • print: This is the command that tells the computer to display something.
  • (): The parentheses hold the information you want the computer to display.
  • "Hello World from Innovation Camp Australia!": The text inside the quotation marks is called a string. Quotation marks tell Python that this is a piece of text and not another command.

Step 4: Run Your Program!

At the top of the Trinket window, find and click the Run button (it looks like a ▶ play symbol).

Look at the console on the right side of the window. You should see the words: Hello World from Innovation Camp Australia!

Congratulations! You have just written and run your very first Python program. You gave the computer an instruction, and it listened perfectly. You are officially a coder!

Challenge Time! Make It Your Own

The best way to learn is to experiment. Try these two challenges in your Trinket window.

  1. Challenge 1: Can you change the code to make it print your own name? (Hint: Just change the text inside the quotation marks!)
  2. Challenge 2: Can you make the program print two different lines? Try adding a second print() command on a new line.

It could look like this:

print("My name is Alex!")

print("I am learning to code.")

What You’ve Learned & What’s Next

You’ve taken a huge first step today! You learned how to use a code editor, how to write a print() command to display text, and how to run a program.

Now that you can make the computer talk, what’s next? In our next lesson, we’ll learn about variables—the digital boxes you can use to store information like your name or a game score.

You just took your first step into the amazing world of coding! If you enjoyed this and want to learn even faster with guidance from expert instructors, our workshops are the perfect next step. Register your interest for our Python workshops to dive deeper into fun projects and bring your ideas to life.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Stay Connected

0FansLike
0FollowersFollow
0SubscribersSubscribe

Latest Articles