I started learning Python about a year ago for a web development project during the summer break (but that’s another story). The thing that pulled me in was Django, but I’ve since sticked with Python for a number of projects, both on and offline. So that’s how I got started.
Python is best described in PEP 20 (Python Enhancement Proposal) where we find 19 guiding principles which form the basis of its philosophy. I reproduce them here as they are printed through the Python shell:
I really like Python’s syntax and forced indentation. It was strange at first, but it grew into me quite quickly because it nudged me into a ritual of structured code with a consistent presentation. Also, the language is really expressive with lots of syntactic sugar and a couple of keywords which make reading source very fluid and easier to quickly grasp.
There’s OOP, but you’re not forced into it. Coming from C I only ever use a class if it I feel like it would actually bring me an advantage. I never liked the seas of initializations, getters and setters when a quick function would do the job pretty well. This amazing talk makes a very compelling argument on this point. I do like having the option to use classes (and I do use them!), but mixing them in good old imperative code is much more pleasant. As for functional programming, I try to tell myself that using map() and reduce() qualifies me but deep down I know that’s just a lie. You can however make lots of stuff more functional within Python, and that’s a nice option to have.
Being much more high-level and letting you play on the REPL makes Python really fun, but it also empowers you to build stuff that works in much less time than what I was previously used to. Powerful one liners through list comprehensions, cool generators and native types of lists, tuples, sets and dictionaries make developing stuff a joy. The standard library is also pretty cool and packed with nifty functionality from database interfaces to data compression libraries to a bunch of internet protocol clients, you name it.
If what you want is not in the standard library, there’s a good change that you can find what you need in a library somewhere. Somewhere is usually just a pip command away, which is a really awesome packet manager. Other than that, it feels like everyone and their mothers wrote a bit of Python at some point, so its really likely that you’ll find a good answer to whatever question you might have posted out there on the interwebs.
So that’s why I use Python!