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
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 :
- Open a browser window and navigate to the https://www.python.org/downloads/windows/.
- Select python 3 latest version.
- 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.
- As soon as you click download, it will start automatically.
- Run the installer. A dialog box will appear (Make sure to check the box that says Add python3.x to the path)
- Click on Install Now.
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 :
One or more of these commands should respond with a version like this –
If you already have python3, you are good to go, else follow the below steps to download the latest version.
- Open your terminal.
- Run these commands in sequence
- sudo apt-get update
- 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)
- Open your browser and navigate to http://brew.sh/.
- 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.
- 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.
- When the installing process is done, you will get a dialog box stating ‘The software was installed’.Confirm the dialog box.
- 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
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.
- On your terminal type pip3 and hit Enter.
- 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.
>>> 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. 🙂
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.