What is Python

There was a requirement for me to recruit a resource with scripting knowledge, so I raised the resource requirements concern to my manager. Unfortunately, at the same time,  there was another requirement on our co-team operation to find the resource with skills of domain knowledge. Since two teams required two resources and budget reason, our manager asked us to find the resource who should have both domain knowledge as well as scripting knowledge.

So now it’s on me to prepare the JD about this role,

  1. The resource should be a very dynamic person to understand without declaring anything affront.
  2. Quick decision maker whenever the issues flow.
  3. Well understanding the data to prepare the structured reports.
  4. Good to have incurred knowledge of general coding standards, networking, operating system, etc.
  5. Identify the error, handle the error and report the error in a meaningful way.
  6. Since the recourse is shared for support & operation team, should have the OOPs characteristic of inheriting himself to other team members such as conducting training, KT session and should not be dependency creator.

May be! we could find the resource with this expectation but beyond that, we also need that resource to be easily understandable, more interactive interpreter, productivity, versatility on start & end time and last but not least that the resource should quickly compile the internal process and provide an outcome.

After so many iterations of the interview process, finally, we found very good resource named Python.

Being in production support, achieving internal ops oriented automation with limited option of “shell script” , “batch script” or “SQL” is not always up-to our mark but luckily we found Python who has incurred many characteristics using which we can achieve any kind of peripheral automation performed without relying on development team.\ or environment.

Most of the guys who start their career in production support, would first learn the shell scripting and SQL (structured query language).

Almost all Unix/Linux servers preinstalled with Python  (version up-to 2.7) and ready to use with interactive interpreter environment.

I started this article with real time scenario so that it would easy for the initiator to understand more about Python programming language and how effective way it can be used.

Python is powerful programming language which is very easy to learn and fun to code, as it is not very hard to code with curly brackets or keywords which we need to always in mind and keep track of brackets as where it is opened and where it is closed.  The coding is easy with simple indentation to delimit the code block as below

>>> if 1 == 1:⇒ colon to start the block
... ←ind→print("Here it is indentation, it's nothing but one tab space")
Here it is indentation, it's nothing but one tab space

The speciality in Python is, it encompasses the approach of object oriented programming (OOPS) so that I can write a class which can be referenced by object, code reusable, hiding the data and inherit the class to child class.

python has the capabilities to understand data types such as the number, string, float, etc and do not required to declare anywhere in the code but you need to define before referring it.

>>> a=10
>>> type(a)
<type 'int'>    #recognize the data as integer.
>>> b='Vinoth'
>>> type(b)
<type 'str'>    #recognize the given data as string since the data assigned enclosed in quotes. 
>>> c=12.22
>>> type(c)
<type 'float'>  #recognize the data as float.
>>> d='python','shell'
>>> type(d)
<type 'tuple'>  #recognize as tuple compound data type. Will discuss about this more on upcoming articles.
>>> e = ["Python",3]
>>> type(e)
<type 'list'>   #recognize as list compound data type. Will discuss about this more on upcoming articles.

# – comments in code

May be if you are good in using vocabulary (syntax), you can finish your sentence in one line of code. Python is dynamically typed which means the compiler and execution happened at run-time so it’s not required to compile the code separately.

Memory management is automatically handled in Python, memory management is a vital part when we code in any other programming college like malloc & free in “C” and garbage collection in “Java”. Due to this memory management handling, some developers got the name of “Poor programmer”.

Memory management is the task which has to be allocated when new object created and same has to be released after that object used, to pass on to another object for reuse.

Like other programming languages, python also has the control flow tools such as,

IF : To make decision and flow the control accordingly.

>>> iam="Python"
>>> if iam == 'Python': print("Easy to learn")
Easy to learn
>>> #Now i will change the values of "iam" to "Shell" and flow the changes
>>> iam="shell"
>>> if iam == 'Python':>>> if iam == 'Python': print "Easy to learn"else: print "I already know"

FOR: It is shell script like for loop, so we can iterate over the sequence and flow your code as below

>>> iam=["Python","Shell"]

>>> for lan in iam: #Its easy to iterate the sequence and flow the code accordingly.
        if lan == "Python": 
                print lan+" is Easy to Learn" 
                print lan+" is already known"
Python is Easy to Learn
Shell is already known

We have also other control statement such as break, continue & pass which we will discuss whenever it is required in the coding practices.

Feed up more on this one article would bore you. So I will stop here and let you explore more about it. You can also comment your doubt ,queries and logics.

1 thought on “What is Python”

Leave a Reply