好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Python2.7与Python3.7区别

今天,我将带大家看看Python 2.7与Python 3.7这两个版本区别。

python3.7 cmp()已经不存在了,如果你需要实现比较功能,需要引入 operator 模块,适合任何对象

>>> import operator>>> operator.eq('hello', 'name');False>>> operator.eq('hello', 'hello');True

区别四:string 字母 大小写字符串

string.letters:包含所有字母(大写或小写)的字符串

Python 3.0中,string.ascii_letters.

【推荐课程:Python专栏课程】

以上就是Python 2.7与Python 3.7区别的详细内容,更多请关注Gxl网其它相关文章!

查看更多关于Python2.7与Python3.7区别的详细内容...

  阅读:80次