How to Install Python for your PC ?

Needless to say you cannot learn Python if you don't have it installed in your system. SO LETS DO THAT FIRST !!!



Downloading Python:

To download python you can simply go to the official website and download the file setup which installs python in your system.

You can also download python using this link :


Download the version which suits your OS and move on to the next step,

Installing Python:

Once you have downloaded Python, go to the folder where you have downloaded it and run the file. Follow the instructions and Python should be installed in your system ready for you to use it.

Running Python for the First Time (Using CMD:

To run python in cmd, simply run cmd and type in the command 'python' and press Enter. This should start python in cmd. Now go on and play around with it. Do some simple calculations like 2+2, 54*67 etc. I still remember how I felt like doing all these calculations. The first thing I thought was, "Damn!! This is so simple !", because I was used to Java, which is much more complicated. And I was also very excited about learning a new language. Anyway, lets explore Python a little more. You can only do so much with CMD. To get a glimpse of the real power of Python, lets download an editor for Python.

Running Python in an editor:

An EDITOR is simply a software that unleashes the full potential of a programming language. For example, BlueJ is an editor for JAVA. An editor is also known as an IDE (Integrated Development Environment).

Similarly, we have many editors for Python.The most commonly used are PyCharm and Sublime Text. Now it is completely your choice on which editor you wish to choose. I personally like PyCharm due to several reasons. PyCharm is also widely used by professionals. But I use Sublime Text as well (Yes I am a complicated guy). But again it completely depends on you, you can always download both of them for free from the official website. The following links will take you directly to the official websites (you don't need to tire your fingers searching on google, I have got you covered):

Download PyCharm here (Download the community one for free use)

Download Sublime Text 3 here (It is totally free. You can download the version compatible with your OS)

Now, when you have downloaded any of the above editors just install it and run it.

Using Sublime Text 3:

 Running sublime text should open a window like this


Simply click on the 'File' option in the top left corner and select 'New File'. It should create a file named 'untitled'.Type the keyword 'import' (Don't worry I'll teach you what it does later). Now go to 'File' again and select 'Save as' option or simply use Ctrl+Shift+S (USE THIS !! Learn some basic keyboard shortcuts, you guys are going to be programmers. DUHH !!). Now save the file as 'New.py' (or any name you want but .py is essential). What you will notice right away is the sudden change in the font color, the word 'import' has now turned red in color. This is because you are now using a python file and not an ordinary file. As long as you don't save the file with .py (an extension for python files which basically tells your OS that this file is a python file and not an ordinary file) your are going to be working on a normal file or a text file (and trust me it's not convenient). 

So whenever you start working on a new program, the first thing you should do is give the file a name and save it with a .py extension.

Using PyCharm:

When you start PyCharm, it's going to configure a few things. After PyCharm is done loading, it should look something like this



Click on 'New Project', another window should pop up like this




Name your project and use recommended settings. Click on 'Create'. And it should look something like this


Now right click on the name of the project you created in left pane


And select 'New' and then 'Python file' in the drop down menu. Give name to your python file and press Enter. Your Python file has been created. 

You may notice that unlike Sublime Text, You don't have to add .py in your filename as PyCharm does it for you.

Creating Your First Python Program :

This may sound exciting, BECAUSE IT IS. You will be creating your first program.

Just open the editor you want to use and follow me:

print() Statement:

This has to be the most basic statement in python programming and this will be the first one you will be learning.

print() is an in-built functon in Python. The brackets () are used to pass a certain function.

In other words, print() function helps you print a statement in Python. For example, Type the following in your editor:
'print("Hello, World!")'

And run it in the following way:

Sublime Text 3:

Press Ctrl+B 

PyCharm:

Press the green play button on the top right portion of the screen


The output should be 'Hello, World!'.



CONGRATULATIONS!! You have created your first python program. You have officially started on your journey to becoming an excellent programmer.

If you are a beginner, intermediate, advanced or just someone interested in programming, feel free to join or telegram channel and be among people like you:


And do you know the best part? Joining it is FREE !!!

So go ahead click on the link and I will see you there. 

HOPE YOU HAVE AN AWESOME DAY AHEAD !!!