Python---Basics review (Others)

Source: Internet
Author: User

One: The order of the in-stack in the statement

Same as other languages (c,c++, etc.) into the stack order is the right end of the first execution into the stack (python3.5), before the python2.7 in the stack order is left first

Python2.7:

Python2.7.Ten(default, May at  -, the: -:xx) [MSC v. the  -bit (AMD64)] on Win32type" Help","Copyright","credits"Or"License"  forMore information.>>> ls = [1,2,3]>>>print Ls,ls.reverse () #print先入栈执行, and then reverse the stack execution [1,2,3] None>>>Print ls[3,2,1]

Python3.5:

Python3.5.4(v3.5.4: 3f56838, the8  ., Geneva: -: to) [MSC v.1900  -bit (AMD64)] on Win32type" Help","Copyright","credits"Or"License"  forMore information.>>> Li = [4,3]>>>print (Li,li.reverse ()) #右端先入栈执行reverse, and then outputs the results of Li,li.reverse () none[3,4] None>>>Print (LI) [3,4]

Python---Basics review (Others)

Related Article

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.