Python Notes – 1

I think python is best for any personal use (small scale development) prototyping ideas etc.

Some examples:
Like say I want to parse a document for some specific keywords and format the extracted data.
I want to get update when something on some website changes.
I want to teach a lesson to a spammer by sending him lots and lots of email.
For investing you want to make sense out of some stocks historic data. Using numpy and pandas. Using pandas reading data in meaningful way from a web resource is as easy as reading it from local file.
You want to download all the news paper resources (having a particular date format) from an internet location

All above are my actual use cases to give you an idea.Apart from this I think Python is made for interviews it is very simple to write algorithms or create a data structure in Python. (I guess)

That said now let us get to work and learn some python you will find many online resources really good resources or you can join open/free courses from coursera or similar sites. If you don’t want all this you can right away jump into coding and google(basically stack overflow) your requirements as it arises. (given that you have prior experience with programming and at least one language). This may be problamatic as it will not teach you to code in the Pythonic way. But you can cover that later by browsing some existing good resources/libraries.

Lots of talking now let us get back to work the really boring stuff in language learning syntax.

Note: The notes are all personal it is not meant to cover everything in the language. I am biased towards whatever interested me more or whatever was new for me.

** exponent
Example: 2**3 = 8 = 2 ^ 3

// Integer division/floored quotient

5//2 = 2 % gives you remainder as usual

List in python are object same as string although string are immutable similar to java string.

I don’t know why I assumed that python list should be like C++ STL vector. This was a shock to me when I got to know that python list are object just like any array in Java or C++. So if you pass it in a function which is modifying it it will be modified in caller also.
I was thinking may be in Python as long as possible things will be copied and passed around.

To be continued…


12 thoughts on “Python Notes – 1

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s