Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Error of name 'xrange' is not defined #5

Open
HP1111 opened this issue Nov 24, 2017 · 3 comments
Open

Getting Error of name 'xrange' is not defined #5

HP1111 opened this issue Nov 24, 2017 · 3 comments

Comments

@HP1111
Copy link

HP1111 commented Nov 24, 2017

I m new to this, but just copied full code in python 3.6 and got error xrange not defined is there any input file or something needed other than just coping code down and executing?

@xCloudx8
Copy link

xCloudx8 commented Jan 2, 2018

xrange is a python built-in function no previous installation needed, check the syntax https://www.pythoncentral.io/how-to-use-pythons-xrange-and-range/

@patrickmcgrory
Copy link

change xrange to range

@fsbooks
Copy link

fsbooks commented Mar 8, 2018

To embellish comments: xrange is a a python 2 function, which does not exist in python 3 (more precisely, python 2 range went away with python 3, with xrange renamed to range). See bottom of the pythoncentral link provided by xCloudx8. I suspect you also had problems with print which was changed from a "special statement" to a function. You can't "print x" in python 3, rather use "print(x)".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants