Python language is written by Guido van Rossum in late 1980 is one of the Best interpreted languages. Python is used as the first programming choice of both Google, Ubuntu, RedHat. Python Interpreter is the best interpreter.
The Python interpreter
The Python interpreter is a program that reads Python program statements and executes them immediately. To use interpreter it requires opening the command prompt or terminal windows in your development environment and write command python, and it will show this result and start interpreter. I am using Window 10’s Ubuntu shell.
Python interpreter executes program statements immediately. To Experiment python statements , Python command will start interactive mode and it will be very useful to try out things.
Here are some Examples of one-line commands:
In above examples, one will print Hello World, other will do multiplication and the third one calculates Decimal to Binary using bin().
The >>> prompt is used to enter one-line commands or code blocks that define classes or functions . In above example, only one-liner commands are given. In next example please find multi-line code blocks.
Here are some Examples of multi-line code block:
In above example, it will compare two strings.
help() function is another awesome way to get help on python keywords, functions, etc.
Here is the example of checking syntax and guide of bin command. Press q to return to python interactive interpreter.
I love the way Python Interactive Interpreter works. How about you?