The next installment will be the “Hello world” program in C++ and Go.
Python is an interpreted language, which means all we need to write a program in it is to download the lanugage and start up the interpreter.
We’ll be using the Python interpreter in interactive mode, which means we’ll be writing a single statement and the interpreter will be executing only that line.
First download Python3: Scroll to the bottom and Click on your operating system
Once it has installed, the folder name should be something like “Python 3.7” Now locate the program called IDLE within that folder and open it.
This should open the Python 3.7.3 Shell.
We start writing Python scripts after the > > > prompt.
Type the following:
>>> print("Hello world")
And press enter.
The string Hello world should have printed out.
Congratulations! You coded your first program in Python.
You may already have Ruby installed on your computer. Depending on which operating system you’re using, open your terminal emulator to check:
- macOS: open your Terminal application
- Linux: open up a shell
- Windows: open Command Prompt
which Ruby If it gives you a path name such as /usr/bin/ruby, that means you already have Ruby installed. If it doesn’t, that means you have to install Ruby
Now that we’ve confirmed we have Ruby, we can use IRB which stands for Interactive Ruby, similar to Python’s IDLE.
For macOS and Linux users, simply type
irb into your Terminal or shell. For Windows users, open Interactive Ruby from the Ruby section of your Start Menu.
puts "Hello world"
puts is just like Python’s
Congratulations! You’ve written your first program in Ruby!
Open your operating system’s terminal emulator and type
This should look familiar!
It should print Hello world to the console.
BUT LET'S NOT STOP THERE!
For this, download Chrome if you don’t already have it.
Once you open the Chrome browser, right-click on the browser window and choose
Inspect from the dropdown menu.
A window should open up. Now, at the top of that window you should see an Elements tab and a Console tab. Click the Console tab.
Does this look familiar at all? After the
And press enter.
You should see Hello world printed to that Console.
But, there’s a cooler thing we could do!
Try typing this:
Press enter, and check out the browser page. It should be a blank page with Hello world on it!