Hello World! Program
The “Hello world” program is a classic in computer programming, typically to display the syntax and characteristics of a given language. Python is a very simple language, and has a very straightforward syntax. The Hello World program can be written as follows:
print("Hello world!")
print() is a function that tells Python to display or output whatever we put in the parentheses. By default, this will output to the current interpreter window. Some functions, like the print() function, are built-in functions included in Python by default. These built-in functions are always available to use in programs that you create. Printing a string requires the word or sequence of characters to be enclosed quotation marks.
Once you launch this program, it will display this screen:
You can start typing code directly into this. Just type print("Hello world") and hit enter, and it should display the output directly under the line you just typed, like below
After opening IDLE, you should be able to execute the code the same way as the interpreter. Here is what it should look like
print("Hello world!")
print() is a function that tells Python to display or output whatever we put in the parentheses. By default, this will output to the current interpreter window. Some functions, like the print() function, are built-in functions included in Python by default. These built-in functions are always available to use in programs that you create. Printing a string requires the word or sequence of characters to be enclosed quotation marks.
There are various ways to edit/run Python code.
First, you will need to install Python. You can visit the official Python website and download the latest version there. Once this is installed, you are ready to create your first program.1. Python Interpreter
The Python Interpreter is part of what is installed when you download Python. It can typically be found by searching “Python” in the Windows search bar (or by looking in the applications folder on your Mac).Once you launch this program, it will display this screen:
You can start typing code directly into this. Just type print("Hello world") and hit enter, and it should display the output directly under the line you just typed, like below
2. IDLE
IDLE is an integrated development environment for Python. In our case, it can be used in the same way as the Python interpreter is. This is part of what is installed when you download Python. It can typically be found by searching “Python” in the Windows search bar)After opening IDLE, you should be able to execute the code the same way as the interpreter. Here is what it should look like





As I mentioned in my last post Python is a very popular language. It is very easy to see why this is the case with the simplicity of getting the program up and running. Unlike other programs where you have a large download and have to jump through hoops to find a working compiler, Python seems pretty much like a plug and play. That paired with the simple syntax of the language just puts it ahead of many other languages that end up being more of a pain for someone like an intro programmer.
ReplyDeleteExactly! Python is known not only for it's readability and ease of programming, but it's simplicity in setup. This is a huge reason as to why it's so widely used by schools and businesses. It only takes a few simple steps to get it running. Additionally, it is easy to run on an online compiler, which makes it more accessible.
Delete