A new experience – Diving into python.

A new experience – Diving into python.

Python! The word which suits the Python programming language very well. Today was the first day of my python experience and really, the flexibility it gives us is unreal. Python makes concepts like resizing a list(array), declaring variable, declaring functions and reversing a string a child’s play.

Just to give you all a perspective of the awesomeness of Python, following are few examples,

  • No semicolons –

Oh yeah! You read it right. No semicolons. Remember of the time when as a beginner you write a program after a lot of efforts and think that you have done it all right but when you compile it you get an error which you can’t understand. That annoying error which you ignore without even reading it properly. There is no sign of anything like that in Python. Just write your code right away without any worry of missing a semicolon at the end of each line.

  • Variables –

To declare a variable in Python, just declare a variable by giving it any random name and assign a value to it as follows, while in other languages like Java you first have to specify the type of the variable and then only you can assign a value to the variable. This may seem too trivial to you but trust me, this is really very cool.

#Python code (the text followed by a '#' is a comment)
myint = 7
#Equivalent Java code
int myInt = 7;

Now suppose you want a variable initialised with a floating point data. All you have to declare a variable as about but instead of a integer assign a floating point data as follows-

myint = 7.0

But in Java you have to declare a variable as a float data type and then only you can assign a floating point data in that variable.

  • No compiling –

Exactly! How a code can run without being compiled?! Unlike Java and C++, Python is a interpreted language and the python interpreter just takes your program(saved in a .py file) and do some magic on that and give you a running program in your terminal. So a big no no to “javac meraProgram.java” and “gcc meraDusraProgram.cpp”.

  • Python gives you Power –

I love math and the way Python can do it, no other language can achieve even that level. In Python, if you want to raise a number(lets say x) to the power of another number(lets say, y) then all you have to do is this little thing,

#this will print x^y

So just to give you an essence of Python’s power, I tried to raise 111111 to the power of 111111. I was expecting an error or something but surprisingly I got this-

# and guess what, I have pasted just 1/8th of the output here. 
# Try it yourself

This is my first day with Python and I am very much fascinated by the language. I will keep sharing my views on Python as I progress in learning it.

Places where this Python is dangerous-

My Mother always says “Junglee janwar junglee hi hote he, kabhi bharosa nahi karna chahiye unko(Wild animals should never be trusted).” and if you are a beginner, just stay away from this Python. Although Python has a really low learning curve, I think python is the worst language for a person who is totally beginner to the field of programming. Its concepts make you lazy. You can do a given task in lesser number of keystrokes than any other programming language and if you are a beginner, this language makes it really hard for you to understand basic(but extremely important) concepts like pointers, data types, variable scope, string manipulation etc. of other programming language like C++ and Java.

-Abhay Maniyar


2 thoughts on “A new experience – Diving into python.

  1. Hi! As a computer science tutor who teaches both Java and Python, I have to say that I almost always prefer to teach Python over Java (even though I work in Java full time at my day job). Many students get easily confused when they have to do things such as compile a Java file and this can cause them to feel overwhelmed and get discouraged.
    Python is nice in the regard that you can fire up IDLE and get busy. What do you think?

    Liked by 1 person

    1. I totally agree with you. It’s really very easy to work on Python as compared to Java. Less number of keystrokes, total control over system through libraries, easy syntax. All these things make it easy for beginners to get interested in programming.


Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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