Lesson 2: Introduction to Python
Hello, World!
A phrase you will see when learning a new programming language is "Hello, World!".
A "Hello, World!" program is a computer program that outputs (i.e. displays) the message "Hello, World!". It is very simple in most programming languages, and is used to show the basic syntax (i.e. words and style) of a programming language. It is often the first program written by people learning to code.
With this in mind, the best place to start is with a "Hello, World!" Python example.
Note - the best way to learn programming is to actually do some programming. There are countless website tutorials that provide code examples. There are also websites that allow you to practice as you learn.
Here are three options to get started:
- Use the code editor on this website to test things out. There's one further down this page.
- IDLE , the official IDE (integrated development environment, i.e. software application) for Leaving Cert. You can download this to your computer. This is recommended for creating projects.
- Thonny, another official IDE for Leaving Cert. Similar to the above option. They are quite similar and it is up to you which one you would prefer to use.
Try It Out
Review the code in the left column and click on the Run button.
Notice that text flashes on the right column. This is the server starting up and compiling the code (more on this later). It will eventually start and display the words "hello world".
Notes
- Can you see any connection between the code in the left column and the result on the right column?
- What happens if the syntax (i.e. language) is incorrect? E.g. try adding `printed('hello world')` and press Run. Note that `printed` should be `print`.
- For the above bug (i.e. error), does the error message on the right hand side provide enough information to debug (i.e. solve) the problem?
- Debugging is an important programming skill. It can help you to figure any problems you may have with the code.
Further Reading