I believe that the most important thing in the study of a programming language is generalization. It is a skill that serves a student well in any field of study, including programming.
As a programmer, you will spend a lot of time trying to figure out how to solve a particular problem. You have to learn to start with a general definition of your problem and then work down to the particulars. In my experience, this is a very powerful, and often overlooked, tool.
This post will be aimed at people who are starting from scratch with python. I am going to assume that you have no experience with programming or with python. I am also going to assume that you don’t know what variables, functions, loops, etc are. This post will do its best to teach you those things without assuming that you already know them. I assume that you are coming into this with no programming background at all, or that you have some basic knowledge of other programming languages.
Here is the outline for this post:
A: Learn basic python programming for beginners
A: Using the class of a module
When learning a new language, it is important to understand why you are learning it. So let’s ask ourselves what we want out of python. Personally, I like python because it is simple enough that I can write relatively complicated programs quickly, but complex enough that I can do interesting things with it. The primary reason I like python is that it allows me to be lazy instead of writing small scripts to automate tasks I could do manually. Because I am lazy, I like linters. Linters help me catch stupid mistakes (like missing periods) before they cause me problems (like failing test). Because I like linters, I like PEP8 which is the official Python style guide. Here are the main things that I’m looking for in python:
Simple syntax that can be read by either humans or machines (e.g. code formatting)
Good standard library to provide functionality that I need frequently (e.g. linting)
Linters to catch dumb mistakes before they cause problems (e.g. linting)
Third-party libraries to extend functionality beyond what is included in the standard library (e.g. Django)
A large collection of open source libraries so that I can easily reuse code written by other people (e.g. PyPI)
I hope that’s clear enough. Now that we have an idea of what we are looking for, let’s look at why you should learn python. Here are some reasons why it is good to learn python: