Let’s Start with python Installation
Download Python for your respective windows from here: https://www.python.org/downloads/
The Basics of Python:
Python is an interpreted programming language, this means that as a developer you write Python (.py) files in a text editor and then put those files into the python interpreter to be executed.
Python is very simple and straightforward language. Python is an interpreted programming language, this suggests that as a developer you write Python (.py) files during a text editor then put those files into the python interpreter to be executed.
I believe you have installed python in your system. If not, please go to the below Installation module as priority so that you can practice alongside.
The Python Script Mode:
Invoking the interpreter with a script parameter begins execution of the script and continues until the script is finished. When the script is finished, the interpreter is not any longer active.
The simplest directive in Python is that the “print” directive — it simply prints out a line.
Let’s write our first Python file, called helloworld.py,
which may be wiped out any text editor.
Python files have extension .py.
Type the following source code in a helloworld.py file:
print("Hello, World!")
We have assumed that you have Python interpreter set in PATH variable. Now, try to run this program as follows −
$ python helloworld.py
The Python Command Line:
To test a short amount of code in python sometimes it is quickest and easiest not to write the code in a file. This is made possible because Python are often run as an instruction itself.
Type the following on the Windows, Mac or Linux command line.
Invoking the interpreter without passing a script file as a parameter brings up the following prompt:
$ python Python 3.8.0 (default, Nov 14 2019, 22:29:45) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>>
Type the following text at the Python prompt and press the Enter:
$ python Python 3.8.0 (default, Nov 14 2019, 22:29:45) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> print("Hello, World!")
resultant to above statements:
$ python Python 3.8.0 (default, Nov 14 2019, 22:29:45) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> print("Hello, World!") Hello, World!
Whenever you are done in the python command line, you can simply type the following to quit the python command line interface.
>>> exit()
Learn More:
Visit us for more tutorials:
Java Tutorial
Python Tutorial
RabbitMQ Tutorial
Spring boot Tutorial
Top comments (0)