标签:style one 输出 amd def inf default python2.7 type
同其他语言(C,C++等)一样入栈顺序是右端先进行执行后入栈(python3.5中),在python2.7之前的入栈顺序是左端先
Python2.7:
Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on wi n32 Type "help", "copyright", "credits" or "license" for more information. >>> ls = [1,2,3] >>> print ls,ls.reverse() #print先入栈执行,然后reverse再入栈执行 [1, 2, 3] None >>> print ls [3, 2, 1]
Python3.5:
Python 3.5.4 (v3.5.4:3f56838, Aug 8 2017, 02:17:05) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> li = [4,3] >>> print(li,li.reverse()) #右端先入栈执行reverse,再输出li,li.reverse()的结果None [3, 4] None >>> print(li) [3, 4]
标签:style one 输出 amd def inf default python2.7 type
原文地址:https://www.cnblogs.com/ssyfj/p/8973234.html