My first code – Hello World!
- The 2022 End of Year Website Update - 01/01/2023
- Celebrating Ada Lovelace day - 10/10/2022
- Website update 5/9/22 - 05/09/2022
Writing your first piece of code
It’s something of a Computer Science tradition to write the words “Hello World” as your first piece of code – so let’s do this!
You’ll need to open a new tab or window with Python Online IDE loaded within it and keep this window open as well so you can keep following the instructions.
Click this sentence to open up a new tab with Python Online loaded up.Â
Find the section labelled CODE in the IDE – it should look like the image below.
Click to the right of the number 1 that you can see and type in the words in the box below:
print("Hello World")
Make sure you press ‘Enter’ after you have entered it.
Your screen should look like this:
If you got this – great!
Now you want to run your code. Press the RUN button above where you wrote your code.
When you click the RUN button you should see the following in the OUTPUT section.
If you see this – well done! You’ve just written your first piece of code.
THE IMPORTANT BIT!
You’ve just created your first computer program so you don’t want to lose it do you?!
Save your code by renaming your file from ‘myprogram.py’ in the box and clicking on the save button. Save the file into a folder where you will remember.
Are you getting an error? Check the code very carefully –
- ‘print’ should be lowercase with no capital letters
- Have you used both speech marks ”  “
- Have you used both brackets (Â Â Â )
- Have you made sure there is not a space at the start of your code ‘print’ should start at the far left with no spaces
When you’ve corrected your mistake, click on the RUN button again.