Python Fundamentals for Everyone — Introduction to Python

This is the first of many articles on Python Fundamentals for Everyone, a python tutorial series which focuses on python fundamentals.

At the end of this article you will have knowledge on how to run a python program from your system.

Introduction to Python

Python is a programming language which was developed by Guido van Rossum in the year 1991 for the public distribution at the National Research Institute for Mathematics and Computer Science in Netherlands.

It is free open source software, in layman terms it means that, a piece of code which is publicly accessible — so anyone can view, modify and distribute the code as they see fit.

Python is easy to learn, easy to read, platform independent, object oriented and supports interface with major databases.

Python is an interpreted language, which means that the interpreter runs the python program as soon as we type it in or load in the system. If there exists an error then, it raises an exception and prints the error.

Let’s see how a python program runs

Python can be programmed in two ways:

  1. Interactive Mode Programming
  2. Script Mode Programming

Interactive Mode Programming

Here, we call the python interpreter on command prompt. Command Prompt is the command line interface that interacts with the user.

To open Command Prompt in windows OS, click on the start button, select run and type cmd.

Command Prompt in Windows OS (Image by author)

If python is already installed in your system then type “python” in Command Prompt (cmd) and press enter to open python command line on cmd.

Image by author

Type the following code in command line:

>>> print (“Hello World”)

Image by author

Script Mode Programming

In this mode, the interpreter is invoked with a python script. Python script is nothing but some python code written in an editor for instance notepad, and saved with .py extension, for example, hello.py

So, open an editor like notepad and type the code, for example

print (“Hello World”)

And save the file with .py extension. In this case hello.py

Image by author

Now, run the script by opening the command prompt and traversing to the directory where the script is saved by typing

$python hello.py

Image by author

Congratulations on having made so far!

Now you have knowledge on the two ways through which a python program can be run in your system.

In the next article we will look at variables.

Analytics Vidhya

Analytics Vidhya is a community of Analytics and Data…

Analytics Vidhya

Analytics Vidhya is a community of Analytics and Data Science professionals. We are building the next-gen data science ecosystem https://www.analyticsvidhya.com

Sneha Thomas Mathew

Written by

Decision Scientist. Aiming to share my knowledge on python and data science right from the basics.

Analytics Vidhya

Analytics Vidhya is a community of Analytics and Data Science professionals. We are building the next-gen data science ecosystem https://www.analyticsvidhya.com

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store