The most sought-after general-purpose high level programming language that we use today is Python. In 1991 Guido van Rossum initially designed this programming language and later it was developed by the Python Software foundation. The emphasis was mainly on the code readability and one can express the code in fewer lines.
You can easily work and integrate the systems more efficiently.
In this chapter, we will be learning about Python 2 and Python 3 and both these versions are very different from each other.
Starting with Python programming:
- Find the interpreter:
The interpreter is used to interpret and run the program. You can find many online interpreters which can help you in running a python program.
In windows, when you install the python software, you will automatically get an interpreter installed. And in Linux, it comes already installed.
- Writing the first program:
You can run the following program initially:
Now let us check the code from start to end-
Line 1: [#Code starts] This is a comment, this is ignored by the python interpreter and it is only for the readability of the code for the programmer.
Line 2: [print(“PSTQuiz”)] This is the output statement which is used to print anything on the screen. After the execution of this statement, the cursor will move down to the new line. One can see the difference between python 2 and python 3 by looking at how the print statement is used. In version 2, it is not a function but in version 3 it works as a function having the parentheses.
Line 3: As in statement 1, it is just another comment statement.