Python Basics (Installation)
Tags: python
Published: 2020-03-16 10:16:21

## Introduction
Python is an interpreted, high-level, general-purpose programming language. It has variety of use cases. You can use it for automating certain tasks and do a lot more with it. Here we will see how to install python in your computer. By the way, we are going to use Python 3 not Python 2, so wherever I mention python that will mean Python 3, if not explicitly mentioned something else.

## Contents
* How to install Python
* Other options
* What I use
* Hello World program

## How to install Python
#### For Windows users
Check whether you have python in your system or not, by typing `python` in terminal or command prompt. If you see something like this, then you don't have python installed. 
```shell
> python
'python' is not recognized as an internal or external command, operable program or batch file.
```
Head over to [Python Official Website](https://www.python.org/) and go to the [downloads section](https://www.python.org/downloads/). Choose the latest stable python 3 version, download the executable file and install it. Do not forget to **add python to your path**, so that you can use python from terminal.  
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/m27xpr7swqiubpvpcoci.png)
Make sure that the box, indicated using red arrow sign, is checked.

#### For Linux users
You should already have python in your system. You can verify it by typing `python3` in terminal and then hitting enter. You should see something like this
```shell
$ python3
Python 3.6.9 (default, Nov  7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
```
#### For Mac users
You should have python 2 in your system. To install python 3, you may need to use [Homebrew](https://brew.sh/). You can check out [Python official site](https://docs.python.org/3/using/mac.html) for more information.

## Other options
Other popular options include [Anaconda](https://www.anaconda.com/), [ActiveState Python](https://www.activestate.com/products/python/) and more.

## What I use
I personally use [Anaconda Python](https://www.anaconda.com/distribution/). It comes with its own package manager, called `conda` and it has has lots of packages pre-installed, so you don't have to install them separately. Head over to their [download page](https://www.anaconda.com/distribution/) and download the version suitable for you system.  
Check out their official installation guides.
* [Installing on Windows](https://docs.anaconda.com/anaconda/install/windows/)
* [Installing on macOS](https://docs.anaconda.com/anaconda/install/mac-os/)
* [Installing on Linux](https://docs.anaconda.com/anaconda/install/linux/)


#### For Windows users
You may need to add Anaconda to your path to use it from terminal. To do that, make sure the box, indicated using red arrow sign, is checked.  
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4ghfu8bpduu4z9a0ot11.png)

After the installation is successful, open a new terminal or command prompt and type `python`. You should see something like this  
```shell
> python
Python 3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
```
## Hello World program
In the python shell after the `>>>` sign type `print("Hello World")` and hit enter. You will see output like this
```shell
> python
Python 3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print("Hello World")
Hello World
>>>
```
This is your Hello world program in python. Congratulations!

*This is my first post!*