Hello, World
It's time to start writing some real, working Python code. It'll be very simple for the time being.
As we're going to show you some fundamental concepts and terms, these snippets of code won't be serious or complex.
Run the code in the editor window on the right. If everything goes okay here, you'll see the line of text in the console window.
Alternatively, launch IDLE, create a new Python source file, fill it with this code , name the file and save it. Now run it. If everything goes okay, you'll see the rhyme's line in the IDLE console window. The code you have run should look familiar. You saw something very similar when we led you through the setting up of the IDLE environment.
Now we'll spend some time showing and explaining to you what you're actually seeing, and why it looks like this.
As you can see, the first program consists of the following parts:
Each of the above plays a very important role in the code
The print() function
Look at the line of code below:
print ("Hello, World!")
The word print that you can see here is a function name. That doesn't mean that wherever the word appears it is always a function name. The meaning of the word comes from the context in which the word has been used.
You've probably encountered the term function many times before, during math classes. You can probably also list several names of mathematical functions, line sine or log.
Python functions, however, are more flexible, and can contain more content than their mathematical siblings.
A function (in this context) is a separate part of the computer code able to:
Morever, many of Python functions can do the above two things together.
Where do functions come from?
The name of the function should be significant (the name of the print function is self-evident)
Of course, if you're going to make sure of any already existing function, you have no influence on its name, but when you start writing your own functions, you should considet your choice of names.