Python NameError:name ‘xrange’ is not defined

mac2022-06-30  67

在python3 中会出这个问题,而xrange( )函数时在python 2.x中的一个函数,在Python 3中,range()的实现方式与xrange()函数相同,所以就不存在专用的xrange( ) 解决方法

1. 在python 3 中运行 将xrange()函数换成range() 2. 在python2中运行

要兼容的话 自己想办法

转载于:https://www.cnblogs.com/vercont/p/10210174.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)