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

NameError: name 'xrange' is not defined #8

Open
wwziyin opened this issue Sep 23, 2021 · 2 comments
Open

NameError: name 'xrange' is not defined #8

wwziyin opened this issue Sep 23, 2021 · 2 comments

Comments

@wwziyin
Copy link

wwziyin commented Sep 23, 2021

When I run the program, there is an error:

    for i in xrange(self.step, self.width - self.step/2, self.step):

NameError: name 'xrange' is not defined

Can someone help me? Thanks.

@Zlin7569
Copy link

@progs2002
Copy link

the code is written in python 2. xrange() does not work in python 3, use range()

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

3 participants