Python is a general-purpose high level, interpreted an object-oriented programming language designed by Guido van Heusen in 1991.

It’s one of the easiest language available(syntax much similar to the English language)

Domains where python can be implemented –

  • Machine Learning
  • GUI Applications.
  • Web Applications
  • Image processing
  • Web scraping
  • Software development

Two popular versions of python are Python 2 and Python 3. Both are quite different.

We’ll be learning python 3 through these blogs but that doesn’t mean python 2 is not there in the market. it’s still there, but its support will end in 2020(No longer supported by creators)

 Environments to run python code-

There are different platforms on which you can run a Python code.

  • Python Interpreter(IDLE)
  • Integrated Development Environment – example- Pycharm
  • Notebooks

Before we proceed further let’s understand a simple but useful term that one will hear frequently when working with python i.e Package Manager.

What is the Package Manager?

A package manager is a tool that allows us to install and manage additional libraries and dependencies that are not part of the Python standard library. There are several package manager available for python. The popular ones are – anaconda, pip, Homebrew etc.

Installation of Python3 :

Windows

Step 1

  1. Open a browser window and navigate to the https://www.python.org/downloads/windows/.
  2. Select python 3 latest version.
  3. Scroll to the bottom and select either of windows x86-64 executable installer for 64 bit or windows x8 executable installer for 32-bit version depending on your hardware configuration.
  4. As soon as you click download, it will start automatically.

Step 2

  1. Run the installer. A dialog box will appear (Make sure to check the box that says Add python3.x to the path)
  2. Click on Install Now.

Linux

Installation in Linux

There are high chances that your Linux distribution has python already installed, to check which version of python installed try these commands :

python –version
python2 –version
python3 –version

One or more of these commands should respond with a version like this –
 python 3.x.x

If you already have python3, you are good to go, else follow the below steps to download the latest version.

  1. Open your terminal.
  2. Run these commands in sequence
  3. sudo apt-get update
  4. sudo apt-get install python3

In few minutes, you’ll get a prompt regarding successfully Installed.

macOS and Mac OS X


The best way to install Python 3 on macOS is by using Homebrew package manager

Step 1: Install Homebrew (Part 1)

  1. Open your browser and navigate to http://brew.sh/
  2. Paste the below command in your terminal.

/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
/usr/binruby -e “$(curl -fsSL https:

   This will begin the Homebrew installation.

  1. If you’re doing this on a fresh install of macOS, you may get a pop-up alert asking you to install Apple’s “command line developer tools”. You’ll need those to continue with the installation, so please confirm the dialog box by clicking on “Install”.That may take a few minutes.
  2. When the installing process is done, you will get a dialog box stating ‘The software was installed’.Confirm the dialog box.
  3. Now Homebrew will ask you for your password to finalize the installation. Simply Enter your password and hit Enter. It may take a few minutes for the complete installation.

Hurray! Now you have Homebrew package manager installed properly.

To check whether Homebrew properly installed or not, type

brew help

If you get any output, that means it’s already installed otherwise, follow properly the above steps again.

Now it’s time to install python 3 on your mac system.

Step 2: Install Python

Open your terminal again and type this command.

$ brew install python3

This will download and install the latest version of Python.

To make sure python is properly installed or not.

  1. On your terminal type pip3 and hit Enter.
  2. You should see the help text from Python’s “pip” package manager. If you get an error message running pip3, go through the Python install steps again to make sure you have a working Python installation.


Run your first Python program

Once python is properly installed, type python3 in command line(windows) or terminal(Linux/mac). This will turn your terminal into python shell.

Here you can run your first program.

Type
>>> 1+1 (press Enter)
>>> 2 (output)

>>> print(‘Hello folks’) (press Enter)
>>> Hello folks

Hurray! you have just run your first python program successfully.

In the next session, we’ll deep dive into more python concepts.

Till then Happy Coding. 🙂


Interview Questions 

Q) What is Package manager?

Ans – Package manager is a tool used to install other libraries and dependencies that are not part of the Python standard library.

Q) What could be the possible reason behind Python’s popularity??

Ans – Because of its easy syntax and advancement in Data Science and AI domain, Python now is much more popular than any other languages available. Moreover, Python can be used in various domains.

That’s all I have and thanks a lot for reading. Please let me know if any corrections/suggestions. Please do share and comments if you like the post. Thanks in advance… 😉


Thanks Shivani for helping us to grow day by day. She is passionate to solve challenging problems and loves to play around Python.


Categories: Miscellaneous

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Insert math as
Block
Inline
Additional settings
Formula color
Text color
#333333
Type math using LaTeX
Preview
\({}\)
Nothing to preview
Insert