Before learning a language, you must first understand why you should learn it, not because it is fire, to learn, to understand where the fire, the advantages of where, in what respect other languages can not be replaced. So I learn python originally because it has a good lightweight crawler framework scrapy, actually want to apply the framework is not need to learn python, because the Python syntax is really simple to understand, but since the contact, it is necessary to learn the system.
Well, I'm not going to compare the pros and cons of PHP, Python, Ruby, and so on, with a lot of posts on the web. Or the spirit of "life are short, I use Python" mentality to learn; here also exhort those confused in the language of the children's shoes, think well a door has been learning, until the goal of learning this language, not recommended for learning and to learn, or that is genius patent.
Bought a "Head first Python", read for half an hour to regret, found that the book is too basic, a few pages of things for a touch of 7, 8 languages, I almost look at two eyes, hand knock an example can be. If you are a person with a lot of experience, or have a good command of PHP, then this book is not very recommended. But if you buy it, stick with it, because there's a more urgent learning plan behind it.
Development IDE, I do not have python3 belt, I use pycharm this model.
(a) List
PHP has exactly the same definition, and the functionality is similar.
Arr1=[1,2,3,4,5,6]arr1sub = [' A ', ' B ', ' C ']arr1.insert (1,arr1sub) print (ARR1) for x in arr1: print (Isinstance (x, List))
Output:
[1, [' A ', ' B ', ' C '], 2, 3, 4, 5, 6] Falsetruefalsefalsefalsefalsefalse
The first 30 pages of this book, this one code fragment is all.
Definition List
arr1=[1,2,3,4,5,6]
Insert List
Arr1.insert (1,arr1sub)
Loop List
For x in arr1:
Determine if a variable is a list
Print (Isinstance (x,list))
Python Learning notes (i)