Python Learning II

Source: Internet
Author: User

Recently wrote a little Python code, as a Java programmer, in the face of Python so convenient language can't help but a little excited. But sometimes there are things that you can't understand.

For example:

ER = [[],      [4,5,6],      [7,8,9]] Print(er)#here is a strange and strange error, if print (ER) This statement preceded by a space,        #will be error "unexpected indent", if you remove the space to run successfully        #not yet aware of Python's operating mechanismcols = [Row[1] forRowinchER]#explain the meaning of "row[1] for row in ER"        #Row[1] for line 1th should be a row in this array of ERPrint(cols) cols= [row[1]+1 forRowinchER]Print(cols) num1= 10cols= [Row[1]-num1 forRowinchER]Print(cols) cols= [row[1]+1 forRowinchErifrow[1]%2==0]Print(cols) cols= [Er[i][i] forIinch[0,1,2]]Print(cols)

Really don't understand it! You can only remember it here first.

Python Learning II

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.