python2和 python3的一些区别

1 输出

print  python2可以不加入括号,python3就不行

2list 里面的 方法

python2 中包含   cmp 方法  比较  list1 和list2    返回值有  -1 0 1     

print(cmp(list1,list2))   list1 大于 list2 是1  =是0  小于 是返回 -1

3 file 方法 python3中没有了

原文地址:https://www.cnblogs.com/alanling/p/9677468.html