Is Python an easy language to learn?
Largely, programming consists of two things. The ability to formulate algorithms and architectures to solve problems is one of them. The other is mastering the syntax, and resources, provided by a language and the tools that support it.
How hard this is depends on you more than it depends on python. For a newbie, I don't think, given a good book, tutor, or body of sample code, python or, say, C++, are any harder to learn than any other language of the same general class. I think a C++ programmer with some experience will be able to transfer his or her knowledge to python, and vice versa.
Python does have a lot going for it in terms of simplicity. There is a rich set of modules associated with it. In many ways, it is "easier" to do things in python, but you still have to seek out the libraries, learn what's available, and work thru writing code to implement whatever problem you are trying to solve. I think anyone claiming it is "easy" isn't really examining all the ways that programming can, and always will be, demanding in terms of effort, and thus I would not fall into the trap of telling you python is easy. Easier in some cases, but in a great many cases, I think the effort expended is much the same as in other languages.
To illustrate here is a program in C++ to add two numbers from the command line and print the result (I'm ignoring error checking in both these examples, e.g., I expect two numbers passed as arguments):
- #include <cstdio>
- #include <cstdlib>
- int
- main(int argc, char *argv)
- {
- printf("%d\n", atoi(argv[1]) + atoi(argv[2]));
- }
In python:
- import sys
- if __name__ == '__main__':
- print int(sys.argv[1]) + int(sys.argv[2])
I had to declare the arguments to main in the C++ case, but I needed more syntax to use these arguments in python.
The concepts behind both programs are about the same. Both identify a main program, both expect arguments to come into main via an array named argv. Both require you to import/include some external definitions. Both require you to convert the command line arguments to integers. I don't think learning these concepts was any harder in C++ than in python.
Bottom line, I wrote the python app more easily only because I already am accustomed to C++/C and know the model for passing arguments to a program from the command line that is independent of the language, and more a property of how processes work in your typical operating system. It took me about as much effort to "learn" how to do this in python as it took for me to learn it in any other language.
So, just be wary of claims that python is "easy". In many ways, it's not any easier than any other language, depending on what you are doing. Algorithms and architecture, the problems you are solving, could be much more of an issue than the syntax and properties of the programming language you choose.