Python Learning notes (i)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.