General Operations in python

Alright I hope you have python installed on systems by now. If not you can refer to the previous post to know how to and from where to install Python programming language.

For now you can use the online available compiler.

Now if you are already familiar with Coding in C++  you would all know a statement is terminated using ” ; ” but here in python we dont use semi colon but rather whitespaces determine the the flow of code so for example body of a while loop in C++ and other similar language is governed by the { } curly braces example below:

while (condition)




In python this is done by indenting or giving white space.

for example while loop in python :

while condition :

<whitespace> <body>

< body continued>

To read more about the white space follow this link to stack overflow

Today we deal with Basic requirements like print , defining variables and working with variables 

  • Variable in python

Defining and initialising variables is very easy in python as there is no requirement for specifying the data type the variable is going to hold.

so a simple definition of a variable named integer can be done as follows

>>> Integer=10

A string can be defined by using quotes as follows

>>> String= ” My name is jot “


>>>String= ‘ My name is jot ‘


  • Print procedure 

print function or procedure can be used to output a result or display a value of a variable . No need to enclose the  variable  in brackets

>>> print ” my name is jot ”              # prints the string

>>> print Integer                                  # print the value stored in the integer variable


For now these are the basics. We will be  now be discussing arithmetic operations on variables .

Ohk so we start off with the very basic Python arithmetic operations .

General purpose interger addition substraction are demonstrated below

>>> 1+2




These are very basic operations and I assume there is not much need in elucidating or  to expound upon these. I will therefore skip to very important aspects of any programming language to Data Structures in the next post


Installing python

First thing you need to do to get yourself comfortable with the python environment and its format.

In order to do that you need to have python up and running on your system or run it online using the following.

I would suggest to get used to python first online and then installing it onto your system which is recommended as it will be lot more easier to input file and work with them.

python executable file for the windows and mac OSX installer can be downloaded from this link

python 32-bit version is recommended as most the libraries are developed for 32-bit version.

In the next post we will be discussing the basic methods in python.


To start off

First off …. Thank you very much for paying a visit to this page.

Alright so we will be starting off with the python for machine learning blog today. Here what’s in store for you visitors out here.

Through this blog I’ll be initially posting and dealing with the general python language operations that are needed to be known before hand so that the coding can be done easily without wondering about the syntax of the language.

As we all know that effectiveness of a particular machine learning method/algorithm is fundamentally determined by the kind of features/Data   being fed to it . It is very essential to know how to handle this data. Hence general purpose knowledge of the language in our case python is very much essential.

As we gradually get accustomed to the language . we will be starting off with concepts in Machine Learning . I would assume that you are having atleast some knowledge regarding the machine learning and its uses . Later on we may introduce some concepts like Map-Reduce and other added bonus features.

This blog is specially for those who have little or minimal knowledge computer science …