Prerequisites and First Program in Python

Hi Guys,

Here I present to you my second blog. This will be dedicated to Python, a versatile language, which I believe everyone can learn and easily enjoy. My last blog was on C, a very fundamental language. If you are interested in C. You can click on this link .


This time, I plan to make a video series as well. I will post a link of my videos as soon as I finish uploading them. I thank you for the all the support I received in the first blog.


Prerequisites :- 


You can use both major versions of Python ( i.e. Python 2 or Python 3). For more information visit the following link :  https://www.python.org/



Python GUI is available for all platforms (MacOSx, Linux, Windows). I prefer to use Linux because of it's open source nature. Interesting, Terminal based Python comes in-built with both MacOSx and Linux, which I feel is sufficient. I am using Ubuntu-14.04 for the purposes of these tutorials.



Unlike C, Python is language of packages and there is thousands of libraries that has been built in, to make your life easier. We will seem those much more in detail later posts. i just want to introduce a package installer for Python to you, also known as, PIP.


You can get instruction to install PIP in the following links:




Windows : https://github.com/BurntSushi/nfldb/wiki/Python-&-pip-Windows-installation
Linux : https://www.liquidweb.com/kb/how-to-install-pip-on-ubuntu-14-04-lts/



Once you are done in with PIP installation on Linux. You  can check if it's installed correctly by doing typing (Linux or MacOSX):









Once you are all set with PIP installation we are good to go. If you couldn't, don't worry we don't need PIP for writing our first couple of programs.

# First create a *.py  file using any editor. I prefer to use VIM editor. To create a new file you can simply do  vi helloworld.py . You can read more about VIM here.


 # "#" in python used to comment out the line.
 # First program in python #
 print("Hello World\n")


That's it for the first program. See you in the second.















   

1 comment:

  1. Nice... Need more of this kind of approach. Highly recommended for newbie programmers.

    ReplyDelete